Fixed search for itags and urls according to YouTube API Pattern #41
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please see comments.
"Live and streaming videos are unsupported." | ||
) from None | ||
try: | ||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't import inline, do it with the others.
@@ -11,7 +11,7 @@ | |||
|
|||
setup( | |||
name="yturl", | |||
version="2.0.2", | |||
version="2.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't bump the version until the release tests pass, which are not run here. Please remove this. :-)
try: | ||
import json | ||
return collections.OrderedDict([(i['itag'], i['url']) for i in | ||
json.loads(api_response['player_response'])['streamingData'][ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this isn't black formatted, so CI won't be happy :-)
return collections.OrderedDict([(i['itag'], i['url']) for i in | ||
json.loads(api_response['player_response'])['streamingData'][ | ||
'formats']]) | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use bare except, check the exceptions you actually care about. For example, this will even catch keyboard interrupts...
@dpserretti, are you going to adjust the patch? |
Fixed search for itags and urls according to new YouTube API Pattern