srob650 / pytvmaze Goto Github PK
View Code? Open in Web Editor NEWPython interface to the TV Maze API (www.tvmaze.com)
License: Other
Python interface to the TV Maze API (www.tvmaze.com)
License: Other
show_akas fails to run
>>> show_akas(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pytvmaze/tvmaze.py", line 383, in __repr__
return '<AKA(name={name},country={country})>'.format(name=name, country=country)
NameError: name 'name' is not defined
Still struggling. Can't figure out why I get the above mentioned error.
`>>> import pytvmaze
tvm = pytvmaze.TVMaze(username, api_key)
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'pytvmaze' has no attribute 'TVMaze'
`
When I run the same code step by step in the Terminal it works, within a python file it gives the above-mentioned error. Not sure what I'm doping wrong.
`import pytvmaze
username = xxx
api_key = xxx'
show = 'Only Murders In The Building'
season = 2
number = 3
tvm = pytvmaze.TVMaze(username, api_key)
showtvm = tvm.get_show(show_name=show, embed='episodes')
ep = showtvm[season][number]`
Hello im using flexget and discover, everything was working fine but last few day im getting error:
2016-04-23 14:18 CRITICAL task get_tvshows BUG: Unhandled error in plugin discover: 'NoneType' object has no attribute '__getitem__' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flexget/task.py", line 438, in __run_plugin return method(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/flexget/event.py", line 22, in __call__ return self.func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/discover.py", line 274, in on_task_input entries = self.estimated(entries, estimation_mode) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/input/discover.py", line 190, in estimated est_date = estimator.estimate(entry) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/estimators/est_released.py", line 28, in estimate estimate = estimator(entry) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/estimators/est_release_series_tvmaze.py", line 51, in estimate episode = lookup(**kwargs) File "/usr/local/lib/python2.7/dist-packages/flexget/utils/database.py", line 31, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/api_tvmaze.py", line 520, in episode_lookup series = APITVMaze.series_lookup(session=session, only_cached=only_cached, **lookup_params) File "/usr/local/lib/python2.7/dist-packages/flexget/utils/database.py", line 28, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/flexget/plugins/api_tvmaze.py", line 467, in series_lookup pytvmaze_show = get_show(**prepared_params) File "/usr/local/lib/python2.7/dist-packages/pytvmaze/tvmaze.py", line 415, in get_show show_web_channel, embed=embed) File "/usr/local/lib/python2.7/dist-packages/pytvmaze/tvmaze.py", line 467, in _get_show_by_search show = _get_show_with_qualifiers(show_name, qualifiers) File "/usr/local/lib/python2.7/dist-packages/pytvmaze/tvmaze.py", line 444, in _get_show_with_qualifiers country = show.web_channel['country']['code'].lower() TypeError: 'NoneType' object has no attribute '__getitem__'
Could you please help me solve this :) Im using last version of flexget 1.2.521
Fuzzy matching will produce the below error in python3:
File "/usr/local/lib/python3.4/dist-packages/pytvmaze/tvmaze.py", line 93, in get_show
s = fuzzymatch.fuzzy_search(search_text, results)
File "/usr/local/lib/python3.4/dist-packages/pytvmaze/fuzzymatch.py", line 115, in fuzzy_search
return max(matches, key=lambda key: matches[key])
TypeError: unorderable types: dict() > dict()
More detail here I believe. http://stackoverflow.com/questions/22333388/dicts-are-not-orderable-in-python-3
I will try work up a pull request.
When attempting to convert a Character to unicode:
>>> import pytvmaze
>>> show = pytvmaze.get_show(maze_id=161, embed='cast')
>>> unicode(show.cast.people[0].character)
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
unicode(show.cast.people[0].character)
File "C:\Python27x64\lib\site-packages\pytvmaze\tvmaze.py", line 255, in __unicode__
return self._repr_obj(as_unicode=True)
AttributeError: 'Character' object has no attribute '_repr_obj'
Howdy,
I modified your library slightly for python3 support. Would love to add it in so I don't have to copy!
https://github.com/brookesy2/pynab/blob/development-postgres/lib/tvmazelib.py
Thanks!
Title says it all.
Doing this (3341 is the ID for the show Fixer Upper):
import pytvmaze
show = pytvmaze.get_show(maze_id=3341, embed='episodes')
Results in error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 374, in get_show
return show_main_info(maze_id, embed=embed)
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 563, in show_main_info
return Show(q)
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 56, in __init__
self.populate(data)
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 112, in populate
self.episodes.append(Episode(episode))
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 163, in __init__
self.summary = _remove_tags(data.get('summary'))
File "/usr/local/lib/python2.7/site-packages/pytvmaze/tvmaze.py", line 319, in _remove_tags
return re.sub(r'<.*?>', '', text)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 155, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer
tvm = pytvmaze.TVMaze("[email protected]", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
tvm.get_followed_shows()
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\h.fauland\Downloads_Projects\myTvOrganizer\venv\lib\site-packages\pytvmaze\tvmaze.py", line 739, in get_followed_shows
return [FollowedShow(show) for show in q]
File "C:\Users\h.fauland\Downloads_Projects\myTvOrganizer\venv\lib\site-packages\pytvmaze\tvmaze.py", line 739, in
return [FollowedShow(show) for show in q]
File "C:\Users\h.fauland\Downloads_Projects\myTvOrganizer\venv\lib\site-packages\pytvmaze\tvmaze.py", line 414, in init
self.maze_id = data.get('show_id')
AttributeError: 'str' object has no attribute 'get'
As per jamesmeneghello/pynab#215, Show
needs to define the __bool__
function, else shows with empty season lists evaluate to False/None/0
.
Would be nice to request information about nextepisode for example.. I understand that the url is in show.links, but there's no 'native' from within pytvmaze to pull information on said episode, at least that i'm aware of anyway.
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.