Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
VGTV.no protected content fails #5853
Comments
|
It does not work for me in browser either. Can you watch it in browser? |
|
Yeah, it works fine for me. It may be geo-protected though. I compared the f4m manifest with a f4m manifest from a ripable video, and this element was the only major difference:
The token/protection probably prevents the current script from working on the video. |
|
It tells me
so nothing about geo restriction at all. |
|
The error means "An unknown error occurred. Please try again later", so they may just have been too lazy to implement a proper error message for geo blocking. Or there's a completely different error on your end. Flashgot (for Firefox) was able to find the manifest and download it, + all the segments, without any issues. I MITM'ed my iPad and watched both a ripable video and a protected one. The difference is clearly the HMAC/token protection. On the unprotected video the segments has URLs like this:
while the protected video has segment URLs like this:
The first URL is likely still accessible, but the protected one immediately returned 403 errors (likely because of time+something missing from the HTTP request) Flashgot saved the manifest for the protected video from this URL:
Here's the manifest for an unprotected video:
|
|
I managed to grab the video by MITM my iPad and really quickly copying the m3u8 manifest URL into livestreamer with the command:
The link expires really quickly, I had to attempt it a few times to make it work. At least it proves that ripping the video via a script like youtube-dl is definitely possible. |
|
this patch will extract the token and add it to manifest url(need someone to test it): diff --git a/youtube_dl/extractor/vgtv.py b/youtube_dl/extractor/vgtv.py
index 8a574bc26..c85e47d23 100644
--- a/youtube_dl/extractor/vgtv.py
+++ b/youtube_dl/extractor/vgtv.py
@@ -176,16 +176,28 @@ class VGTVIE(XstreamIE):
formats = []
+ token = None
hls_url = streams.get('hls')
+ hds_url = streams.get('hds')
+ manifest_url = hls_url or hds_url
+ if manifest_url and re.match(r'https?://[^/]*secure', manifest_url):
+ token = self._download_webpage(
+ 'http://svp.vg.no/svp/api/v1/token?vendor=%s&acl=/*' % vendor,
+ video_id, fatal=False)
+
if hls_url:
+ if token:
+ hls_url += '?hdnea=' + token
formats.extend(self._extract_m3u8_formats(
hls_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
- hds_url = streams.get('hds')
if hds_url:
hdcore_sign = 'hdcore=3.7.0'
+ hds_url += '?' + hdcore_sign
+ if token:
+ hds_url += '&hdnea=' + token
f4m_formats = self._extract_f4m_formats(
- hds_url + '?%s' % hdcore_sign, video_id, f4m_id='hds', fatal=False)
+ hds_url, video_id, f4m_id='hds', fatal=False)
if f4m_formats:
for entry in f4m_formats:
# URLs without the extra param induce an 404 error |
|
@remitamine Tried your patch, but no luck
Output:
But this fails:
Output:
|
|
@vidaritos the version of |
|
@remitamine Gotcha, I added --prefer-ffmpeg and it worked fine! |
Youtube-DL fails to download certain content on VGTV.no, like this one:
http://www.vgtv.no/#!/video/110355/den-tapte-narkotikakrigen