summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-04-04 23:13:52 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-04-04 23:13:55 +0200
commitf8514f618607a23d7307d5faa287299b6c907030 (patch)
treeaa8aee7057741250f3b2dad67e71acc58202aaf1
parente09b8fcd9d2abee53d56362b9589d7ae32c985a8 (diff)
downloadyoutube-dl-f8514f618607a23d7307d5faa287299b6c907030.tar.gz
youtube-dl-f8514f618607a23d7307d5faa287299b6c907030.tar.xz
youtube-dl-f8514f618607a23d7307d5faa287299b6c907030.zip
[rts] Use visible id in file names
Maybe the internal ID is more precise, but it's totally confusing, and the obvious ID still allows a google search.
-rw-r--r--youtube_dl/extractor/rts.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/rts.py b/youtube_dl/extractor/rts.py
index 40224d761..0f85b2320 100644
--- a/youtube_dl/extractor/rts.py
+++ b/youtube_dl/extractor/rts.py
@@ -37,7 +37,7 @@ class RTSIE(InfoExtractor):
             'url': 'http://www.rts.ch/emissions/passe-moi-les-jumelles/5624067-entre-ciel-et-mer.html',
             'md5': 'c197f0b2421995c63a64cc73d800f42e',
             'info_dict': {
-                'id': '5738317',
+                'id': '5624067',
                 'ext': 'mp4',
                 'duration': 55,
                 'title': 'Bande de lancement de Passe-moi les jumelles',
@@ -98,17 +98,20 @@ class RTSIE(InfoExtractor):
         m = re.match(self._VALID_URL, url)
         video_id = m.group('id')
 
-        def download_json(video_id):
+        def download_json(internal_id):
             return self._download_json(
-                'http://www.rts.ch/a/%s.html?f=json/article' % video_id, video_id)
+                'http://www.rts.ch/a/%s.html?f=json/article' % internal_id,
+                video_id)
 
         all_info = download_json(video_id)
 
         # video_id extracted out of URL is not always a real id
         if 'video' not in all_info and 'audio' not in all_info:
             page = self._download_webpage(url, video_id)
-            video_id = self._html_search_regex(r'<(?:video|audio) data-id="(\d+)"', page, 'video id')
-            all_info = download_json(video_id)
+            internal_id = self._html_search_regex(
+                r'<(?:video|audio) data-id="([0-9]+)"', page,
+                'internal video id')
+            all_info = download_json(internal_id)
 
         info = all_info['video']['JSONinfo'] if 'video' in all_info else all_info['audio']