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 member-only videos on VTM.be #9974

Closed
MichaelDeBoey opened this issue Jul 1, 2016 · 24 comments
Closed

Support member-only videos on VTM.be #9974

MichaelDeBoey opened this issue Jul 1, 2016 · 24 comments

Comments

@MichaelDeBoey
Copy link

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.07.01
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Question

$ youtube-dl -v http://vtm.be/video?aid=144670
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://vtm.be/video?aid=144670']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.07.01
[debug] Python version 2.7.10 - Darwin-15.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Proxy map: {}
[generic] video?aid=144670: Requesting header
WARNING: Falling back on generic information extractor.
[generic] video?aid=144670: Downloading webpage
[generic] video?aid=144670: Extracting information
ERROR: Unsupported URL: http://vtm.be/video?aid=144670
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1481, in _real_extract
    doc = compat_etree_fromstring(webpage.encode('utf-8'))
  File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 2524, in compat_etree_fromstring
    doc = _XML(text, parser=etree.XMLParser(target=_TreeBuilder(element_factory=_element_factory)))
  File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 2513, in _XML
    parser.feed(text)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: not well-formed (invalid token): line 70, column 17
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 676, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 343, in extract
    return self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 2182, in _real_extract
    raise UnsupportedError(url)
UnsupportedError: Unsupported URL: http://vtm.be/video?aid=144670


Description of your issue, suggested solution and other information

When I try to run youtube-dl http://vtm.be/video?aid=137771 it works like expected.
When I try to run youtube-dl http://vtm.be/video?aid=144670it doesn't.

I think it has something to do with the fact that the first video can be watched by everyone.
It's just a sneak peak of an episode.
The second video is a full episode, so you can only watch it when you're logged in.

So I tried to run youtube-dl with the -u option and provided my username, and after that I provided my password when requested.
But that also didn't work unfortunately.
I keep getting the following log:

[generic] video?aid=144670: Requesting header
WARNING: Falling back on generic information extractor.
[generic] video?aid=144670: Downloading webpage
[generic] video?aid=144670: Extracting information
ERROR: Unsupported URL: http://vtm.be/video?aid=144670

Am I doing something wrong?

I allready found #4318, but that's not really the problem I think, because it works with videos that doesn't need an account to watch (ie: not full episodes)

@himanshuraja
Copy link

@himanshuraja himanshuraja commented Jul 1, 2016

put whole url in quotes " " so that shell can understand .

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

That gives the same result @himanshuraja

@TRox1972
Copy link
Contributor

@TRox1972 TRox1972 commented Jul 1, 2016

@MichaelDeBoey Since the site is not fully supported, try to use the --cookies option instead of -u.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

Still the same result @TRox1972 😞

Is it because it has no specific .py-file within the youtube-dl source code that it doesn't work when you need to log in?

Maybe @yan12125, @dstftw, @jaimeMF or @remitamine can better answer that last question?

@TRox1972
Copy link
Contributor

@TRox1972 TRox1972 commented Jul 1, 2016

@MichaelDeBoey Did you follow these instructions? Does the cookie-file contain the cookies you get after login with a web browser?

The site in question does not have an own extractor (.py-file if you will), and the videos and information collected is therefore collected by the generic extractor, which doesn't supported authentication by username. However, if you pass in the cookies you get when logging in to the site via your web browser, the generic extractor may be able to catch the video in question, as it does with 'free-access' videos on the site.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 1, 2016

In some cases cookies works fine, while not always. If this is the case, writing extra codes is inevitable.

@yan12125 yan12125 added the request label Jul 1, 2016
@yan12125 yan12125 changed the title Can't figure out how to download this video (full episode) from VTM.be Support member-only videos on VTM.be Jul 1, 2016
@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

@TRox1972 No I didn't.
I now tried it the way explained in the instructions, but I keep getting the following error:

file does not look like a Netscape format cookies file

It's because cookies are storred in .sqlite format I think.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 1, 2016

It's because cookies are storred in .sqlite format I think.

FYI: cookies as sqlite are not supported yet. Use cookies exporter to get a plain text file.

@himanshuraja
Copy link

@himanshuraja himanshuraja commented Jul 1, 2016

in question website does not have an own extractor in format that we use as extension .

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

@TRox1972 & @yan12125 just tried it with the cookies (downloaded with the extention like you said) as an option, but it still doesn't work. :/

So I guess this can only be solved by adding a new extractor?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 1, 2016

So I guess this can only be solved by adding a new extractor?

By your results, yes.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

@yan12125: There's also some valuable info in the Session Cookies and Local Storage I think.
Is there a way to pass these or isn't that supported?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 1, 2016

In terms of video downloading, implementation of session cookies is the same as other cookies. and local storage eventually goes into cookies/URL parameters/post data, etc. Anyway, a new extractor is necessary.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

Anyway, a new extractor is necessary.

OK that's a pitty :/

I've been looking around and found some information to possibly get the .m3u8-file.
So I think someone can make a new extractor with that information like they did with #7079?
I'm not familiar with Python so... 😞

@yan12125: Do I make a new issue or do I paste it here?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 1, 2016

The most difficult part is login. Public-available videos on vtm.be uses HTML5 <video>, and I guess it holds for private videos, too. The most difficult part is login.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 1, 2016

@yan12125: I found a website where it explains (in Dutch) how you can get the .m3u8-file for the specific video, when you have login credentials.

  • You first need to make an Medialaan-account.
  • Then go to the following link, which will provide you an JSON-file
    https://accounts.eu1.gigya.com/accounts.login?APIKey=3_HZ0FtkMW_gOyKlqQzW5_0FHRC7Nd5XpXJZcDdXY4pk5eES2ZWmejRW5egwVm4ug-&sdk=js_6.1&format=json&loginID=[INSERT E-MAIL HERE]&password=[INSERT PASSWORD HERE]
  • This JSON-file will give you an UID, an UIDSignature & a signatureTimestamp
  • Then go to the following link, which will provide you with a second JSON-file http://vod.medialaan.io/api/1.0/item/[INSERT VIDEO ID HERE]/video?app_id=vtm_watch&user_network=vtm-sso&UID=[INSERT ENCODED UID HERE]&UIDSignature=[INSERT ENCODED UIDSIGNATURE HERE]&signatureTimestamp=[INSERT SIGNATURETIMESTAMP HERE]
    The video-id can be found by taking the id from the link:
    http://vtm.be/video/volledige-afleveringen/id/256911617431000 gives 256911617431000 as video-id
    I haven't figured out yet how to get the video-id if the shortlink (http://vtm.be/video?aid=144670) is used
    The UIDSignature needs to be encoded before using it in the link.
  • The second JSON-file has an uri, which should be the URL to the .m3u8 playlist-file for that video.

Maybe @TomGijselinck, @lodev, @dstftw or @remitamine can help with implementing this?

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 2, 2016

@yan12125, @dstftw, @remitamine: Is this enough information or do I need to try and get some more?

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Jul 2, 2016

Public-available videos on vtm.be uses HTML5 <video>, and I guess it holds for private videos, too.

@yan12125: about the HTML5 video-tags: I just tried to look into this, but only the public available videos have this. If you want to watch the full episodes (the ones that need an account), you need at least Flash Player 11.2 😞

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Aug 15, 2016

@yan12125, @dstftw & @remitamine: I think I provided enough info to make a new extractor or do I need to provide some extra info?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 16, 2016

That should be enough. Need someone with an account to implement it.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Aug 16, 2016

@yan12125 you can easily make a new Medialaan account for yourself if you want. :-)
The site's in Dutch, but I think you understand the form-fields?

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Aug 16, 2016

Or I can make you a new one as well @yan12125?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 17, 2016

Sorry, but currently I don't have much time on implementing this. Maybe others can help.

@MichaelDeBoey
Copy link
Author

@MichaelDeBoey MichaelDeBoey commented Aug 17, 2016

No problem @yan12125 :-)
@TomGijselinck is going to give it a try when he has the time, but that's not for the near future unfortunately :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.