From 52585fd6dcd5020f2800d133588d7232419dddc0 Mon Sep 17 00:00:00 2001 From: codesparkle Date: Fri, 30 Jan 2015 18:41:40 +1100 Subject: [PATCH 1/4] The opening curly brace `{` is a regex reserved [control character](http://stackoverflow.com/a/400316/1106367), so it needs to be escaped. --- youtube_dl/extractor/generic.py | 2 +- youtube_dl/extractor/grooveshark.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 41884ed7a5..a6f102a4e8 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -1073,7 +1073,7 @@ class GenericIE(InfoExtractor): found = filter_video(re.findall(r'''(?xs) flowplayer\("[^"]+",\s* \{[^}]+?\}\s*, - \s*{[^}]+? ["']?clip["']?\s*:\s*\{\s* + \s*\{[^}]+? ["']?clip["']?\s*:\s*\{\s* ["']?url["']?\s*:\s*["']([^"']+)["'] ''', webpage)) if not found: diff --git a/youtube_dl/extractor/grooveshark.py b/youtube_dl/extractor/grooveshark.py index fff74a70a8..848d17beb4 100644 --- a/youtube_dl/extractor/grooveshark.py +++ b/youtube_dl/extractor/grooveshark.py @@ -83,7 +83,7 @@ class GroovesharkIE(InfoExtractor): return compat_urlparse.urlunparse((uri.scheme, uri.netloc, obj['attrs']['data'], None, None, None)) def _transform_bootstrap(self, js): - return re.split('(?m)^\s*try\s*{', js)[0] \ + return re.split('(?m)^\s*try\s*\{', js)[0] \ .split(' = ', 1)[1].strip().rstrip(';') def _transform_meta(self, js): From 1d2daaea6372f5119be8fc21637a275fe93a52ff Mon Sep 17 00:00:00 2001 From: codesparkle Date: Fri, 30 Jan 2015 20:10:12 +1100 Subject: [PATCH 2/4] Simplify list creation --- youtube_dl/extractor/cinchcast.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/youtube_dl/extractor/cinchcast.py b/youtube_dl/extractor/cinchcast.py index 0c9a24befd..e23c515d9c 100644 --- a/youtube_dl/extractor/cinchcast.py +++ b/youtube_dl/extractor/cinchcast.py @@ -28,12 +28,7 @@ class CinchcastIE(InfoExtractor): item, './{http://developer.longtailvideo.com/trac/}date') upload_date = unified_strdate(date_str, day_first=False) # duration is present but wrong - formats = [] - formats.append({ - 'format_id': 'main', - 'url': item.find( - './{http://search.yahoo.com/mrss/}content').attrib['url'], - }) + formats = [{'format_id': 'main', 'url': item.find('./{http://search.yahoo.com/mrss/}content').attrib['url']}] backup_url = xpath_text( item, './{http://developer.longtailvideo.com/trac/}backupContent') if backup_url: From 5468ff4d917eeb292ce0bfe7cf13eef75cccae19 Mon Sep 17 00:00:00 2001 From: codesparkle Date: Fri, 30 Jan 2015 20:11:51 +1100 Subject: [PATCH 3/4] Remove duplicate dictionary keys --- youtube_dl/YoutubeDL.py | 1 - youtube_dl/extractor/appletrailers.py | 1 - 2 files changed, 2 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 14e92ddcf7..ce3abaee39 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1075,7 +1075,6 @@ class YoutubeDL(object): 'requested_formats': formats_info, 'format': rf, 'format_id': rf, - 'ext': formats_info[0]['ext'], 'width': formats_info[0].get('width'), 'height': formats_info[0].get('height'), 'resolution': formats_info[0].get('resolution'), diff --git a/youtube_dl/extractor/appletrailers.py b/youtube_dl/extractor/appletrailers.py index 70621946d8..287f71e076 100644 --- a/youtube_dl/extractor/appletrailers.py +++ b/youtube_dl/extractor/appletrailers.py @@ -122,7 +122,6 @@ class AppleTrailersIE(InfoExtractor): playlist.append({ '_type': 'video', 'id': video_id, - 'title': title, 'formats': formats, 'title': title, 'duration': duration, From 749f2ca044dc32c6a3ae9e9c55e4a22b091e2635 Mon Sep 17 00:00:00 2001 From: codesparkle Date: Fri, 30 Jan 2015 20:35:20 +1100 Subject: [PATCH 4/4] Smotri info extractor: removed unreachable code and updated old md5 for test video --- youtube_dl/extractor/smotri.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/youtube_dl/extractor/smotri.py b/youtube_dl/extractor/smotri.py index e94f41362d..24746a09a0 100644 --- a/youtube_dl/extractor/smotri.py +++ b/youtube_dl/extractor/smotri.py @@ -108,7 +108,7 @@ class SmotriIE(InfoExtractor): # swf player { 'url': 'http://pics.smotri.com/scrubber_custom8.swf?file=v9188090500', - 'md5': '4d47034979d9390d14acdf59c4935bc2', + 'md5': '31099eeb4bc906712c5f40092045108d', 'info_dict': { 'id': 'v9188090500', 'ext': 'mp4', @@ -139,9 +139,6 @@ class SmotriIE(InfoExtractor): def _search_meta(self, name, html, display_name=None): if display_name is None: display_name = name - return self._html_search_regex( - r'' % re.escape(name), - html, display_name, fatal=False) return self._html_search_meta(name, html, display_name) def _real_extract(self, url):