Coder Social home page Coder Social logo

kodi.tvmaze's Introduction

kodi.tvmaze's People

Contributors

adambrauntonpers avatar romanvm avatar tvgazza911 avatar tvjan avatar twolife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kodi.tvmaze's Issues

Scraping fails if a show title contains non-ASCII characters

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

Accented character in network causes error

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.

Scraping shows with no rating

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 ***

rating = float(show_info['rating']['average'])

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.

Scraper does not always use a show's main image

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.

[TV Show] Ratings

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 :)

Errors while scraping TV Shows

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<--

[metadata.tvmaze (1.0.1)]: *** Unhandled exception detected: <class 'ValueError'> invalid literal for int() with base 10

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. ;)

TVMAZE Error Log

If I may be of any help, don't hesitate to ask. And thank you for everything. :)

[Episode] UniqueID

The uniqueID for episodes is the following when exported to nfo file...

<uniqueid type="unknown" default="true"></uniqueid>

  1. Should replace the unknown entry with maze
  2. No id is actually scraped. The value is empty which, as you know, can cause issues.

Log file for both reports... https://paste.kodi.tv/odizasopan.kodi

Thanks.

[TV Show] UniqueID

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.

Episode not being scraped

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?

PVR EPG compatible?

Is any possibility to fill PVR's EPG data with this addon?
Were there any attempts/discussion from Kodi side for this, if needed?

Hi,

Does this addon compatible with kodi 19?

Thanks!

Rework caching

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.

The scraper fails to parse a show that has an .nfo file with episodeguide section

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.