From 7a87ad648a781bd681c847f4a011166e02e84c1f Mon Sep 17 00:00:00 2001 From: Tiberiu Chibici Date: Fri, 2 Nov 2018 22:49:24 +0200 Subject: [PATCH] Integrated latest pytaw, which adds support for feed URLs. --- app/external/pytaw/pytaw/youtube.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/external/pytaw/pytaw/youtube.py b/app/external/pytaw/pytaw/youtube.py index 5b14497..1b63532 100644 --- a/app/external/pytaw/pytaw/youtube.py +++ b/app/external/pytaw/pytaw/youtube.py @@ -234,6 +234,21 @@ class YouTube(object): result['type'] = 'search' 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 # impossible to handle properly else: