]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[myspace] Use player_url for faster download
authorTithen-Firion <Tithen-Firion@users.noreply.github.com>
Sun, 30 Nov 2014 18:06:23 +0000 (19:06 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 30 Nov 2014 23:10:11 +0000 (00:10 +0100)
It keeps reconnecting without it. Download time decreased from 7+ minutes to 25 seconds for me.

youtube_dl/extractor/myspace.py

index c3c1a27c3418c2f45f908cd9f6340f61edc8dd61..24da362121f295735a9af935e8a2b848bd5fa34a 100644 (file)
@@ -48,6 +48,8 @@ class MySpaceIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
         webpage = self._download_webpage(url, video_id)
+        player_url = self._search_regex(
+            r'playerSwf":"([^"?]*)', webpage, 'player URL')
 
         if mobj.group('mediatype').startswith('music/song'):
             # songs don't store any useful info in the 'context' variable
@@ -79,6 +81,7 @@ class MySpaceIE(InfoExtractor):
         info.update({
             'url': rtmp_url,
             'play_path': play_path,
+            'player_url': player_url,
             'ext': 'flv',
         })
         return info