This Kodi TV Scraper uses the TVmaze.com API (https://www.tvmaze.com/api)
It can be used for scraping TV Show metadata and artwork from The TVmaze database.
Wiki: https://kodi.wiki/view/Add-on:TVmaze
Website: https://www.tvmaze.com/
TVmaze scraper for Kodi
This Kodi TV Scraper uses the TVmaze.com API (https://www.tvmaze.com/api)
It can be used for scraping TV Show metadata and artwork from The TVmaze database.
Wiki: https://kodi.wiki/view/Add-on:TVmaze
Website: https://www.tvmaze.com/
"English Language Premiere" order for La Casa de Papel is saved in Kodi incorrectly.
https://www.tvmaze.com/shows/27436/la-casa-de-papel/episodes
http://api.tvmaze.com/shows/27436/alternatelists
http://api.tvmaze.com/alternatelists/17/alternateepisodes?embed=episodes
Cached info: https://paste.kodi.tv/ubopinawar
Context:
2020-07-25 21:30:51.120 T:11048 ERROR: [metadata.tvmaze (1.0.3)]: Code context:
41: # type: (Text, Optional[Text]) -> None
42: """Find a show by title"""
43:> logger.debug('Searching for TV show {} ({})'.format(title, year))
44: search_results = tvmaze.search_show(title)
45: if year is not None:
2020-07-25 21:30:51.121 T:11048 ERROR: [metadata.tvmaze (1.0.3)]: Local variables:
title = 'Silent M\xc3\xb6bius'
year = None
2020-07-25 21:30:51.153 T:13560 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://metadata.tvmaze/?action=find&pathSettings=%7b%7d&title=Silent%20M%c3%b6bius
Please replace with LOGFATAL and LOGINFO. They will be removed in a couple of weeks.
PR: xbmc/xbmc#18346
Forum Post: https://forum.kodi.tv/showthread.php?tid=353818
Errors such as:
Error Contents: 'ascii' codec can't encode character u'\xc9' in position 2: ordinal not in range(128)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
File "main.py", line 28, in
router(sys.argv[2][1:])
File "libs\actions.py", line 193, in router
find_show(params['title'], params.get('year'))
File "libs\actions.py", line 53, in find_show
list_item = data_utils.add_main_show_info(list_item, search_result['show'], False)
File "libs\data_utils.py", line 195, in add_main_show_info
video['studio'] = '{0} ({1})'.format(show_info['network']['name'], country['code'])
For example, 'Reeling in the Years' has the network 'RTÉ ONE' with an accented 'e'.
I believe this changeset, removing the u''caused it.
ce697a9#diff-fd9d7d452aaec716d6cf7e31f269ef67R191
I think that you meant to import , unicode_literals in this file, but I'm not entirely certain.
Whenever a show does not have enough votes to have a rating, it will appear in the API as:
"rating":{"average":null}
This causes issue with the set_rating function as it tries to parse null as a float.
*** Unhandled exception detected: <type 'exceptions.TypeError'> float() argument must be a string or a number ***
It should have a check similar to the one above the line if show_info['rating'] is not None:
but instead ensuring that show_info['rating']['average'] isn't null.
For example, in https://api.tvmaze.com/shows/2/images you can see 5 poster
images being returned. However, not the first entry but id 404837
is marked as main image (main: true
) which means that one should be preferred by Kodi as well.
If there are multiple images in the setAvailableFanart
list, I don't know how Kodi determines which one to use - does it simply take the first one? In that case, we should simply sort show_info['_embedded']['images']
by the main
property before iterating.
Hello romanvm
I have scraped a tv show today and note the rating is not correct. The following is the rating when exported to nfo file.
<rating name="default" max="10" default="true">
<value>8.000000</value>
<votes>0</votes>
</rating>
rating name="default" = Should detail which provider supplied the rating- IMDB, TV Maze, other
Possible abbreviate the name to maze ie. <rating name="maze"
votes= No votes are scraped
I guess the rating is from TV Maze, but I could not see any ratings for the tv show. Maybe you need to be logged in?
Would you consider cross-scraping IMDB for their ratings also? The IMDB ID is already provided as a unique id.
Thanks :)
2019-11-14 21:55:48.272 T:12692 ERROR: [metadata.tvmaze (1.0.0)]: **** End diagnostic info ****
2019-11-14 21:55:48.272 T:12692 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: float() argument must be a string or a number
Traceback (most recent call last):
File "C:\Users\Nick\AppData\Roaming\Kodi\addons\metadata.tvmaze\main.py", line 25, in
router(sys.argv[2][1:])
File "C:\Users\Nick\AppData\Roaming\Kodi\addons\metadata.tvmaze\libs\actions.py", line 167, in router
get_details(params['url'])
File "C:\Users\Nick\AppData\Roaming\Kodi\addons\metadata.tvmaze\libs\actions.py", line 94, in get_details
list_item = data_utils.add_main_show_info(list_item, show_info)
File "C:\Users\Nick\AppData\Roaming\Kodi\addons\metadata.tvmaze\libs\data_utils.py", line 179, in add_main_show_info
list_item = _set_rating(show_info, list_item)
File "C:\Users\Nick\AppData\Roaming\Kodi\addons\metadata.tvmaze\libs\data_utils.py", line 108, in _set_rating
rating = float(show_info['rating']['average'])
TypeError: float() argument must be a string or a number
-->End of Python script error report<--
For a while now I've been getting an ever increasing number of errors when "Scanning TV Shows Using TVMaze".
Most are repeating, one per episode or series, I'm not entirely sure which, that look like:
ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/78804/all/en.zip' ***
[Redacted for brevity. See attached log file.]
WARNING: No information found for item '/home/nspectre/Flix/TV/Doctor Who (2005)/', it won't be added to the library.
The remaining sequence of errors (minus debug info, please see attached log) are:
2020-01-16 17:30:00.494 T:32596 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/286058/all/en.zip' ***
2020-01-16 17:30:00.994 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Grantchester/', it won't be added to the library.
2020-01-16 17:30:09.376 T:32609 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/260449/all/en.zip' ***
2020-01-16 17:30:09.998 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Vikings/', it won't be added to the library.
2020-01-16 17:30:20.662 T:32624 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/80660/all/en.zip' ***
2020-01-16 17:30:22.296 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/The Graham Norton Show/', it won't be added to the library.
2020-01-16 17:30:36.670 T:32652 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/76355/all/en.zip' ***
2020-01-16 17:30:37.315 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Silent Witness/', it won't be added to the library.
2020-01-16 17:30:45.074 T:32667 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/348204/all/en.zip' ***
2020-01-16 17:30:45.757 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/The War Of The Worlds/', it won't be added to the library.
2020-01-16 17:30:50.435 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/American Experience/', it won't be added to the library.
2020-01-16 17:30:55.522 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Chicago Fire/', it won't be added to the library.
2020-01-16 17:31:05.741 T:32705 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/81157/all/en.zip' ***
2020-01-16 17:31:06.388 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Nature/', it won't be added to the library.
2020-01-16 17:31:09.149 T:32711 ERROR: [metadata.tvmaze (1.0.1)]: TVmaze returned an error: 404 Client Error: Not Found for url: http://api.tvmaze.com/lookup/shows?thetvdb=82615
2020-01-16 17:31:09.209 T:32711 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'TypeError'> 'NoneType' object is not subscriptable ***
2020-01-16 17:31:09.732 T:32545 ERROR: GetDirectory - Error getting plugin://metadata.tvmaze/?action=getepisodelist&url=http%3a%2f%2fwww.thetvdb.com%2fapi%2f1D62F2F90030C444%2fseries%2f82615%2fall%2fen.zip&pathSettings=%7b%7d
2020-01-16 17:31:09.733 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Particle Physics for Non-Physicists/', it won't be added to the library.
2020-01-16 17:31:20.316 T:32727 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/328634/all/en.zip' ***
2020-01-16 17:31:20.999 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/The Good Doctor/', it won't be added to the library.
2020-01-16 17:31:30.427 T:32742 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/362696/all/en.zip' ***
2020-01-16 17:31:31.132 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/The Witcher/', it won't be added to the library.
2020-01-16 17:31:40.304 T:32757 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/159651/all/en.zip' ***
2020-01-16 17:31:40.966 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/How the Universe Works/', it won't be added to the library.
2020-01-16 17:31:46.090 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/The Resident/', it won't be added to the library.
2020-01-16 17:31:51.578 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/FBI/', it won't be added to the library.
2020-01-16 17:32:01.267 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Chicago P.D/', it won't be added to the library.
2020-01-16 17:32:12.663 T:333 ERROR: [metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10: 'http://www.thetvdb.com/api/1D62F2F90030C444/series/359251/all/en.zip' ***
2020-01-16 17:32:13.395 T:32545 WARNING: No information found for item '/home/nspectre/Flix/TV/Seven Worlds, One Planet/', it won't be added to the library.
2020-01-16 17:32:13.489 T:32545 NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 02:32
I attempted to curl -G 'http://www.thetvdb.com/api/1D62F2F90030C444/series/286058/all/en.zip' and received back the response:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>CloudFront</center>
</body>
</html>
However, if I paste that URL into my browser it properly returns the requested zip file containing XML files for actors, banners and en.
I suspect this has to do with the recent TheTVDB discombobulation fiasco. ;)
If I may be of any help, don't hesitate to ask. And thank you for everything. :)
The uniqueID for episodes is the following when exported to nfo file...
<uniqueid type="unknown" default="true"></uniqueid>
Log file for both reports... https://paste.kodi.tv/odizasopan.kodi
Thanks.
Issue description:
Taking a backup with https://kodi.wiki/view/Add-on:Backup, leads to adding cache data inside it (instead of just getting settings etc.)
Kodi debug log:
Additional context
I note there is no UniqueID from TV Maze. Is this intentional or an oversight? The following is what is scraped...
<uniqueid type="imdb">tt7826108</uniqueid>
<uniqueid type="tvdb" default="true">335985</uniqueid>
Just wondering what would happen if neither IMDB or TVDB fields were completed at TV Maze.
Issue description:
I'm trying to update the info for "The Falcon and Winter Soldier (2021), the interface show my selection of the show and then I get "an error occured, check logs"
Kodi debug log:
https://paste.kodi.tv/pujepakice.kodi
Additional context
worked fine before.. suddenly happens. Using Matrix
Hello there,
Being a TVMaze user to keep track of m shows, I changed all my kodis to used your addon today. All went well (expect that it re-scrapped all my database, resetting all episodes watch status..)
Anyway, all were pick up apart from the second episode of Mrs. Flecther. (https://www.tvmaze.com/shows/35786/mrs-fletcher) Not sure why?
The Studio list (which are Networks & Web Channels on TVmaze) is grouping two 'studios' of the same name even if they have a different ID or Country.
Take these or example:
https://www.tvmaze.com/networks/3/abc
https://www.tvmaze.com/networks/245/abc
If you added a show from each network, the studio list shows them both under 'ABC' even though they belong to different networks.
Is any possibility to fill PVR's EPG data with this addon?
Were there any attempts/discussion from Kodi side for this, if needed?
Does this addon compatible with kodi 19?
Thanks!
Currently full show info is loaded on each scraping, even partial one, that results in extra requests to TVmaze API. Show info should be cached separately from episodes with longer TTL.
If a show has an .nfo file in its directory with episodeguide
section, e.g:
<episodeguide>
<url>http://www.thetvdb.com/api/1D62F2F90030C444/series/350665/all/en.zip</url>
</episodeguide>
this URL is passed to getepisodelist call instead of the one set by the scraper and the scraper fails to get the list of episodes. This looks like a Kodi bug.
Possible workaround: if a non-numeric ID is passed to getepisode list call, parse it the same way as in nfourl call to obtain TVmaze show ID.
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.