patrikvalkovic / csfd-api Goto Github PK
View Code? Open in Web Editor NEWAPI for csfd in JavaScript
License: MIT License
API for csfd in JavaScript
License: MIT License
require()s have 'csfd' argument in the Readme file while it does not work, but 'csfd-api' works just fine.
API vrací chybu u některých filmů, např.
Johanka z Arku: id 14357
Dinotopia: id 85377
Arn - Templářský rytíř: id 230172
pravděpodobně u výše zmíněných filmů chybí potřebná data nebo se změnila struktura webu
call: API.film(id);
TypeError: Cannot read property 'replace' of undefined at parseLength (/node_modules/csfd-api/lib/parsers/filmParser.js:85:37) at Object.module.exports [as film] (/node_modules/csfd-api/lib/parsers/filmParser.js:202:3) at Object.csfd.film (/node_modules/csfd-api/lib/csfd.js:36:18) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
node version: v8.11.3
csfd-api version: "1.1.1"
It looks like something changed on CSFD servers. I am now getting empty results back.
Any tips?
Does this library still works?
Perhaps an issue on my side?
Thanks for any help.
It looks like parseLength
method (in filmParser.js) doesn't work properly and fails on unexpected time format.
I am seeing an exception on this line:
https://github.com/PatrikValkovic/csfd-api/blob/master/lib/parsers/filmParser.js#L90
TypeError: Cannot read property 'replace' of undefined
at parseLength (C:\src\bitbucket.org\janodvarko\movie-lib\server\node_modules\csfd-api\lib\parsers\filmParser.js:90:37)
at Object.module.exports [as film] (C:\src\bitbucket.org\janodvarko\movie-lib\server\node_modules\csfd-api\lib\parsers\filmParser.js:208:3)
at Object.csfd.film (C:\src\bitbucket.org\janodvarko\movie-lib\server\node_modules\csfd-api\lib\csfd.js:37:18)
Happens when calling the following API: await csfd.film(691446);
For this film:
https://www.csfd.cz/film/691446-velke-dobrodruzstvi-ctyrlistku/prehled/
Looks like the time format is unexpected:
Česko, 2019, 72 min (Televizní verze: 4x15 min)
justTime
is set to verze:
but it should rather be set to something like 4x15
HTH
Honza
TypeError: Cannot read property 'trim' of undefined
at Object.elements.map (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/csfd-api/lib/parsers/filmParser.js:51:25)
at /home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/cheerio/lib/api/traversing.js:274:18
at Function.reduce (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/lodash/dist/lodash.js:3735:25)
at module.exports.exports.map (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/cheerio/lib/api/traversing.js:273:23)
at parseNames (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/csfd-api/lib/parsers/filmParser.js:45:19)
at Object.module.exports [as film] (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/csfd-api/lib/parsers/filmParser.js:191:13)
at Object.csfd.film (/home/mediaserver/Dokumenty/Projects/CSFD to nfo nodejs/node_modules/csfd-api/lib/csfd.js:36:18)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Verze: 1.1.3
CSFD ID: 300893
Pravděpodobně je to způsobeno položkou "(další názvy)" v listu názvů jazyků
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.