mirror of
https://github.com/chibicitiberiu/ytsm.git
synced 2024-02-24 05:43:31 +00:00
Integrated latest pytaw, which adds support for feed URLs.
This commit is contained in:
parent
d95cdcdd7f
commit
7a87ad648a
15
app/external/pytaw/pytaw/youtube.py
vendored
15
app/external/pytaw/pytaw/youtube.py
vendored
@ -234,6 +234,21 @@ class YouTube(object):
|
|||||||
result['type'] = 'search'
|
result['type'] = 'search'
|
||||||
result['query'] = url_query['search_query'][0]
|
result['query'] = url_query['search_query'][0]
|
||||||
|
|
||||||
|
# https://www.youtube.com/feeds/videos.xml?channel_id=UC0QHWhjbe5fGJEPz3sVb6nw
|
||||||
|
# https://www.youtube.com/feeds/videos.xml?playlist_id=PLQMVnqe4XbictUtFZK1-gBYvyUzTWJnOk
|
||||||
|
elif url_path[1] == 'feeds':
|
||||||
|
if url_path[2] == 'videos.xml':
|
||||||
|
if 'channel_id' in url_query:
|
||||||
|
result['type'] = 'channel'
|
||||||
|
result['channel'] = url_query['channel_id'][0]
|
||||||
|
elif 'playlist_id' in url_query:
|
||||||
|
result['type'] = 'playlist'
|
||||||
|
result['playlist'] = url_query['playlist_id'][0]
|
||||||
|
else:
|
||||||
|
raise InvalidURL('Unrecognized URL format: ' + url)
|
||||||
|
else:
|
||||||
|
raise InvalidURL('Unrecognized URL format: ' + url)
|
||||||
|
|
||||||
# Custom channel URLs might have the format https://www.youtube.com/LinusTechTips, which are pretty much
|
# Custom channel URLs might have the format https://www.youtube.com/LinusTechTips, which are pretty much
|
||||||
# impossible to handle properly
|
# impossible to handle properly
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user