Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SyFy Full Episodes #3820

Closed
HalosGhost opened this issue Sep 23, 2014 · 4 comments
Closed

Support SyFy Full Episodes #3820

HalosGhost opened this issue Sep 23, 2014 · 4 comments
Labels
geo-restricted site-support-request Add extractor(s) for a new domain

Comments

@HalosGhost
Copy link

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://www.syfy.com/now/helix/full-episode/fushigi/184619587706', '--verbose', '--proxy=']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.09.22.1
[debug] Python version 3.4.1 - Linux-3.17.0-rc5-g46be7b7-x86_64-with-arch-Arch-Linux
[debug] Proxy map: {}
[generic] 184619587706: Requesting header
WARNING: Could not send HEAD request to http://www.syfy.com/now/helix/full-episode/fushigi/184619587706: HTTP Error 404: Not Found
WARNING: Falling back on generic information extractor.
[generic] 184619587706: Downloading webpage
[generic] 184619587706: Extracting information
ERROR: Unsupported URL: http://www.syfy.com/now/helix/full-episode/fushigi/184619587706; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 524, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py", line 180, in extract
    return self._real_extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/generic.py", line 890, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
youtube_dl.utils.ExtractorError: Unsupported URL: http://www.syfy.com/now/helix/full-episode/fushigi/184619587706; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
@jaimeMF jaimeMF added the site-support-request Add extractor(s) for a new domain label Sep 24, 2014
@yan12125
Copy link
Collaborator

yan12125 commented Apr 6, 2016

This URL now redirects http://www.syfy.com/episodes. Do you have another example URL?

@lightonflux
Copy link

@remitamine
Copy link
Collaborator

Another: http://www.syfy.com/theexpanse/videos/101-dulcinea

the video requires an account.

this video doesn't require an account(http://www.syfy.com/12monkeys/videos/201-year-of-the-monkey) but for some reason i get 403 when i try to watch it or download it.
however this patch should make the extractor work again.

diff --git a/youtube_dl/extractor/syfy.py b/youtube_dl/extractor/syfy.py
index 5ca079f..0d49c08 100644
--- a/youtube_dl/extractor/syfy.py
+++ b/youtube_dl/extractor/syfy.py
@@ -1,12 +1,14 @@
 from __future__ import unicode_literals

-import re
-
 from .common import InfoExtractor
+from ..utils import (
+    update_url_query,
+    smuggle_url,
+)


 class SyfyIE(InfoExtractor):
-    _VALID_URL = r'https?://www\.syfy\.com/(?:videos/.+?vid:(?P<id>[0-9]+)|(?!videos)(?P<video_name>[^/]+)(?:$|[?#]))'
+    _VALID_URL = r'https?://www\.syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'

     _TESTS = [{
         'url': 'http://www.syfy.com/videos/Robot%20Combat%20League/Behind%20the%20Scenes/vid:2631458',
@@ -31,16 +33,19 @@ class SyfyIE(InfoExtractor):
     }]

     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        video_name = mobj.group('video_name')
-        if video_name:
-            generic_webpage = self._download_webpage(url, video_name)
-            video_id = self._search_regex(
-                r'<iframe.*?class="video_iframe_page"\s+src="/_utils/video/thP_video_controller.php.*?_vid([0-9]+)">',
-                generic_webpage, 'video ID')
-            url = 'http://www.syfy.com/videos/%s/%s/vid:%s' % (
-                video_name, video_name, video_id)
-        else:
-            video_id = mobj.group('id')
-        webpage = self._download_webpage(url, video_id)
-        return self.url_result(self._og_search_video_url(webpage))
+        display_id = self._match_id(url)
+        webpage = self._download_webpage(url, display_id)
+        syfy_mpx = list(self._parse_json(self._search_regex(
+            r'jQuery\.extend\([^,]+,\s*({.+})\);', webpage, 'drupal settings'),
+            display_id)['syfy']['syfy_mpx'].values())[0]
+        return {
+            '_type': 'url_transparent',
+            'ie_key': 'ThePlatform',
+            'url': smuggle_url(update_url_query(self._proto_relative_url(
+                syfy_mpx['releaseURL']), {
+                    'mbr': 'true',
+                    'manifest': 'm3u',
+                }), {'force_smil_url': True}),
+            'title': syfy_mpx['episodeTitle'],
+            'id': syfy_mpx['mpxGUID'],
+        }

@supermansaga
Copy link

I guess what i don't understand is why the 1080p version I got from syfy after logging in to a cable provider is only half the size of a scene rls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
geo-restricted site-support-request Add extractor(s) for a new domain
Projects
None yet
Development

No branches or pull requests

6 participants