aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-06-27 10:55:25 +0100
committerremitamine <remitamine@gmail.com>2015-06-27 10:55:25 +0100
commitf39eb98bab497d8e06b9f243a8240509326678f0 (patch)
tree46e9a98f5f7e4520f1acbff171559793dc4f0a8a /youtube_dl
parent7d7d4690259f343385a240efcef8d157fc99c72d (diff)
downloadyoutube-dl-f39eb98bab497d8e06b9f243a8240509326678f0.tar.xz
download all pages before start extracting info
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/snagfilms.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/extractor/snagfilms.py b/youtube_dl/extractor/snagfilms.py
index cd345474e..74cd2698d 100644
--- a/youtube_dl/extractor/snagfilms.py
+++ b/youtube_dl/extractor/snagfilms.py
@@ -34,7 +34,6 @@ class SnagFilmsIE(InfoExtractor):
display_id, video_id = match(self._VALID_URL,url).groups()
if display_id is None:
embed_webpage = self._download_webpage('http://www.snagfilms.com/embed/player?filmId=' + video_id, video_id)
-
display_id = self._html_search_regex(
r"snagfilms\.com/films/title/(?P<display_id>.+?)(?:/|')",
embed_webpage,
@@ -48,16 +47,16 @@ class SnagFilmsIE(InfoExtractor):
'data'
), display_id)
+ if video_id is None:
+ video_id = json_data['id']
+ embed_webpage = self._download_webpage('http://www.snagfilms.com/embed/player?filmId=' + video_id, video_id)
+
title = json_data['title']
duration = int(json_data['duration'])
description = json_data['synopsis']
categories = [category['title'] for category in json_data['categories']]
thumbnail = json_data['image']
- if video_id is None:
- video_id = json_data['id']
- embed_webpage = self._download_webpage('http://www.snagfilms.com/embed/player?filmId=' + video_id, video_id)
-
sources = self._parse_json(js_to_json(self._html_search_regex(
r'sources: (?P<sources>\[.*?\])',
embed_webpage,