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

Can't download from a tou.tv account. Site redesigned! #16398

Closed
kobra111 opened this issue May 7, 2018 · 26 comments
Closed

Can't download from a tou.tv account. Site redesigned! #16398

kobra111 opened this issue May 7, 2018 · 26 comments

Comments

@kobra111
Copy link

@kobra111 kobra111 commented May 7, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.05.01. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.05.01

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: [u'--audio-quality', u'0', u'-o', u'%(title)s.%(ext)s']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-u', u'PRIVATE', u'https://ici.tou.tv/unite-9/S05E01']
Type account password and press [Return]: 
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.05.01
[debug] Python version 2.7.14+ (CPython) - Linux-4.15.0-2-amd64-x86_64-with-debian-buster-sid
[debug] exe versions: avconv 3.4.2-2, avprobe 3.4.2-2, ffmpeg 3.4.2-2, ffprobe 3.4.2-2, rtmpdump 2.4
[debug] Proxy map: {}
[tou.tv] Downloading homepage
ERROR: Unable to extract toutvlogin; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 789, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 439, in extract
    self.initialize()
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 397, in initialize
    self._real_initialize()
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/toutv.py", line 52, in _real_initialize
    r'(?s)toutvlogin\s*=\s*({.+?});', webpage, 'toutvlogin'), None, js_to_json)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 820, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract toutvlogin; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

I doesn't have problem to download free content but it doesn't work when I want to download "extra" (premium) videos from an account, tou.tv have change their web site design recently. It worked less than a month with my account before the web site change. The tou.tv login script probably need a update for the new web site.

If you need a login to help you, I can give my account credential.

I hope that my English is not too bad!

Thanks for your help.
Erik.

@kobra111
Copy link
Author

@kobra111 kobra111 commented May 8, 2018

It's geo-restricted to Canada.

@Altruo
Copy link

@Altruo Altruo commented May 8, 2018

I do have the same problem with this site https://ici.tou.tv. The problem is not geo-restricted because I live in the region. Must be an issue with the script that needs an update. Anyone can help ?

@kobra111
Copy link
Author

@kobra111 kobra111 commented May 8, 2018

@Altruo The geo-restriction just mean to developers outside of the Canada that want to help us need a Canadian IP thru a proxy or VPN to be able to work on the problem.

@m-p-3
Copy link

@m-p-3 m-p-3 commented May 10, 2018

Also some of its content can be downloaded without an account (only Tou.TV Extra content needs a valid account).

Example: https://ici.tou.tv/infoman/S18E31

@kobra111
Copy link
Author

@kobra111 kobra111 commented May 11, 2018

Sorry to say that, I doesn't have account anymore. Generally I subscribe a month to download premium content that's interesting and after I unsubscribe to save money.

@m-p-3
Copy link

@m-p-3 m-p-3 commented May 14, 2018

I can provide an account if needed, let me know how to proceed.

@Altruo
Copy link

@Altruo Altruo commented May 15, 2018

That's the problem, it doesn't works for the premium contents, but only regular contents. Youtube-dl doesn't works anymore with the credentials (user & password (-u -p)) for that specific site. But it used to...

ERROR: Unable to extract toutvlogin; please report this issue on https://yt-dl.org/bug .
Make sure you are using the latest version; type youtube-dl -U to update.
Be sure to call youtube-dl with the --verbose flag and include its complete output.

@emilieviau
Copy link

@emilieviau emilieviau commented May 28, 2018

Same problem here. Doesn't work for Extra contents even with appropriate credentials (user and password). Any help on this topic would be highly appreciated!

@whitenoise2
Copy link

@whitenoise2 whitenoise2 commented Jun 21, 2018

Hi. I'm from Montreal, Canada, and I have a premium account for tou.tv. I've started looking into this - it does stem from the UI re-design; tou.tv has moved the client-code generation into obfuscated scripting, which makes the old code no longer work. There might be a way around that.

But, be also aware that even if the login is fixed, more and more content of tou.tv will fail to convert for playback as it is tainted with DRM that only web-browsers can decode, so downloading/converting for offline playback will no longer be a possibility for a portion of the tou.tv content.

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Dec 23, 2018

Hi guys, i think i've found a solution. I have it working on my PC. I just need to make the code cleaner and use a better regex. I'll try to post a PR before January.

@Altruo
Copy link

@Altruo Altruo commented Dec 24, 2018

Great ! Thanks man that would be fantastic.

Merci

@mos8580
Copy link

@mos8580 mos8580 commented Jan 14, 2019

I'm hit by this bug as well. If this PR fixes the problem, is it possible to merge it? Thanks!

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Jan 15, 2019

If you need this fix quickly, i think you can checkout my branch as @tabarnakos did in the PR.

@Altruo
Copy link

@Altruo Altruo commented Jan 16, 2019

Hi Alex it seems that you found a way to fix the problem, but for now it still doesn't work for me, do you think that they will add your fix to the next upload ? Others seem to have find their ways with your PR, unfortunately I'm very bad with coding it's basicaly chinese to me... If you think that they won't had your fix to the next upload would you be kind enough to give an exemple of what should be written in youtube-dl in order to make it work ? al.71@live.ca Merci pour ton bon travail c'est super apprécié !

@tabarnakos
Copy link

@tabarnakos tabarnakos commented Jan 16, 2019

Here's an example of how I use Alex's fix. I don't live in Canada anymore so I need the geo-bypass, which you can omit:
./youtube-dl/youtube-dl --geo-bypass-country CA -u foo@bar.com -p K0mplexPa$$w0rd -f "(mp4,webm)bestvideo[height<=2160]+bestaudio/best[height<=2160]" https://ici.tou.tv/deuxieme-chance/S03E01?lectureauto=1

It works most of the time, for most of the content.

However,l some content fails to download for unknown reason, such as the entire Season 28 of Découvertes:
https://ici.tou.tv/decouverte/S28E02?lectureauto=1

fails with the following error:

[radiocanada] 117214: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 404: Not Found
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug .

but Season 29 works without issues.

Also, some videos fails due to DRM, such as Unité 9 :
https://ici.tou.tv/unite-9/S07E13?lectureauto=1

fails with the following error:

[tou.tv] Extracting Claims
[tou.tv] unite-9/S07E13: Downloading JSON metadata
WARNING: [tou.tv] unite-9/S07E13: This video is probably DRM protected.
[radiocanada] 144354: Downloading metadata XML
ERROR: This video is DRM protected.
@Altruo
Copy link

@Altruo Altruo commented Jan 16, 2019

Thank you tabarnakos@ for your answer, but I don't see what's different in the code you use nor where is Alex's fix. Is it this ? :

-f "(mp4,webm)bestvideo[height<=2160]+bestaudio/best[height<=2160]

Personally I still get a " Unable to extract toutvlogin" with the -u -p option. The video you refer to is not Extra contents, so you can acces it without credential (user/password). My main problem is with Extra contents (not DRM) where I get a " unable to extract toutvlogin"

Here's an exemple of the code I use usually to get my contents (under windows)

youtube-dl -u MY EMAIL ADRESSE -p PASSWORD " https://ici.tou.tv/grizzy-et-les-lemmings/S01E31?lectureauto=1" But that doesn't work anymore on tou.tv

I get the same thing with :
youtube-dl -u MY EMAIL ADRESSE -p PASSWORD -f "(mp4,webm)bestvideo[height<=2160]+bestaudio/best[height<=2160]" https://ici.tou.tv/grizzy-et-les-lemmings/S01E31?lectureauto=1"

Maybe I misunderstood the code you provided, because somehow you download with your credential on the site, while I can't.

Any help is welcome

@tabarnakos
Copy link

@tabarnakos tabarnakos commented Jan 16, 2019

my best guess is that you are not using the right branch...

make sure to not only clone Alex's repository, but also to checkout the toutv_account branch, where he made the changes.

@Altruo
Copy link

@Altruo Altruo commented Jan 16, 2019

It's a good guess lol I don't even no how to use a branch and where to but it. That the thing, I wanted to know what I have to put within the program.

If there is any good Samaritan to explain al.71@live.ca

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Jan 17, 2019

@tabarnakos I got a another PR (#18609) that fixes the DRM check. The fixe is on my master branch on my fork. I pushed a branch containing both fixes (DRM + account) call all_fixes give it a try!

@Altruo I wrote you a comment on your commit on your fork. I can help you there so we don't hijack this thread.

Hope it helps you both!

@tabarnakos
Copy link

@tabarnakos tabarnakos commented Jan 19, 2019

Okay I haven't found a better place to put this. For Decouvertes Season 28 (and a couple other Decouvertes episodes), I found a fix to be able to download the m3u8 playlist, but it is pretty dirty, and as far as I can understand, it fixes a bug on radio-canada's server not giving the right URL.

Here's is the git diff, the modification is in the radio-canada extractor.

@@ -111,6 +111,7 @@ class RadioCanadaIE(InfoExtractor):
                 })
             v_data = self._download_xml(validation_url, video_id, note='Downloading %s XML' % device_type, query=query,
 fatal=False)
             v_url = xpath_text(v_data, 'url')
+            v_url = v_url.replace(',256,400,', ',',1)
             if not v_url:
                 continue
             if v_url == 'null':

It seems as if they have somehow discontinued the 256 and 400kbits streams, but failed to update something in their servers, resulting in error 404 when requesting the m3u8 information. Deleting that part of the string fixes the issue... But I have no idea if it would break other video downloads on radio-canada's website.

@alexhuot1 Are you interested in looking into it? I don't have enough python of web programming experience to know what I am doing, nor what is the right way to fix it.

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Jan 19, 2019

@tabarnakos Yes i'll take a look for sure. I had a very similar problem with the latest District 31 episode. Thanks for the fix!

Edit: OK, it does fix my problem for district 31 also. But i need to remove more than juste 256 and 400. So i need to find a cleaner way to identify which part should be removed. I think we should open an issue only on that. @tabarnakos If you open an issue for that, tag me in it, i'll try to solve it. Thanks

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Jan 21, 2019

@tabarnakos I send a PR for you problem (and also mine ;) ). You can checkout the master branch on my fork to get all my fixes. (account, DRM and bitrates)

@aulismedia
Copy link

@aulismedia aulismedia commented Feb 2, 2019

@tabarnakos / @alexhuot1 Did your fixes make it to the public release yet? I have 2019.01.30.1 and even on non-georestricted emissions I receive "ERROR: radiocanada said: Exception has been thrown by the target of an invocation."

@alexhuot1
Copy link
Contributor

@alexhuot1 alexhuot1 commented Feb 3, 2019

We are still waiting for the PR to be accepted. For now you can checkout master from my fork and test is the fix works.

@remitamine remitamine closed this in 8fecc73 Feb 6, 2019
@Meremptah
Copy link

@Meremptah Meremptah commented Jun 30, 2019

Hello. Do anyone have codes to access to a Tou TV Extra account ?

@m-p-3
Copy link

@m-p-3 m-p-3 commented Jul 11, 2019

@Meremptah unless you work on the project and it's for troubleshooting an issue, you have to pay for that.

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.

You can’t perform that action at this time.