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

[10Play] "403 Forbidden" error #28641

Closed
FlaminHat opened this issue Apr 2, 2021 · 44 comments
Closed

[10Play] "403 Forbidden" error #28641

FlaminHat opened this issue Apr 2, 2021 · 44 comments

Comments

@FlaminHat
Copy link

FlaminHat commented Apr 2, 2021

Why does it say "Forbidden" here?

Output of "verbose" option follows:


[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://10play.com.au/news/sydney/sydney-news-01-apr-2021/tpv210401nupbd', '-o', 'Ten News Sydney, April 1.mp4', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.04.01
[debug] Python version 3.5.2 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Proxy map: {}
[TenPlay] tpv210401nupbd: Downloading JSON metadata
[TenPlay] 9000000000020661: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/Users/imac/miniconda3/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/Users/imac/miniconda3/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 2279, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)


@FlaminHat
Copy link
Author

How do I add cookies or headers with youtube-dl?

@Genesisfury
Copy link

Getting the same error on 10play for a different show. Would really appreciate a fix.

@mist8kengas
Copy link

I get a similar error on Crunchyroll, rolling back to an older version of youtube-dl should fix it.

@Genesisfury
Copy link

Older versions get the same error.

@Alrefai
Copy link

Alrefai commented Apr 8, 2021

I get a similar error on Crunchyroll, rolling back to an older version of youtube-dl should fix it.

Thanks @mist8kengas! Rolling back to version "2021.4.1" fixed the problem with Crunchyroll.

@bnw42
Copy link

bnw42 commented Apr 8, 2021

A yt-dl version from Dec 2020 gives the same error.

@bnw42
Copy link

bnw42 commented Apr 11, 2021

For what it's worth, trying "youtube-dl --username=##### https://10play.com.au/...." gives the same error as noted before, although I do get prompted for a 10Play password before getting the error. Using my 10Play account creds, of course.

@aarubui
Copy link

aarubui commented Apr 11, 2021

Welcome to programming, @bnw42. youtube-dl prompts you when you use --username, no matter what the URL is. No one's written the code for actually using your credentials with 10Play before. You'll have to wait for my pull request to be approved.

@bnw42
Copy link

bnw42 commented Apr 11, 2021

Sorry .. I didn't know the user/pwd option only worked with sites that yt-dl is coded to work with. I thought the user/pwd option was more generic. Life is about constantly learning new things. :) My coding experience is a bit prehistoric (think punch card programming!).

@aarubui
Copy link

aarubui commented Apr 11, 2021

There's some complicated simulation of filling in the actual login form for some of the sites. 10Play's quite straightforward, though.

@bnw42
Copy link

bnw42 commented Apr 11, 2021

Except --username doesn't yet work for 10play. Mind you, even logging onto the website & using an out of the box install of chrome, I can't play videos on the 10play site since they broke yt-dl. But that's not an issue for here.

@stefanodvx
Copy link

Here's the final fix for Crunchyroll.
First of all, check if you can actually access Crunchyroll with your machine.
If you enabled Beta Crunchyroll, disable it from the options of your account

Now, if you need to download a Premium video, follow these steps:

  • Login in your Crunchyroll account using Chrome or Firefox
  • Extract Crunchyroll cookies with any extension (best one is cookies.txt)
  • Edit the cookie file and leave only the session_id, just like this:
    image

Since you using session_id, you don't need to pass account username and password in the options (as login its even broken)

Here's an example script in Python:
image

Hope this will help

@Columbo199X
Copy link

@stefanodvx Can this fix also be used for non premium / free videos? The 403 error on crunchyroll seems to be related to cloudflares bot protection.

@bnw42
Copy link

bnw42 commented Apr 12, 2021

Now for the OPs issue with 10Play ...

@FlaminHat
Copy link
Author

Just to reiterate, here is the output in verbose mode:


[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://10play.com.au/news/sydney/sydney-news-01-apr-2021/tpv210401nupbd', '-o', 'Ten News Sydney, April 1.mp4', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.04.01
[debug] Python version 3.5.2 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Proxy map: {}
[TenPlay] tpv210401nupbd: Downloading JSON metadata
[TenPlay] 9000000000020661: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/Users/imac/miniconda3/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/Users/imac/miniconda3/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 2279, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 472, in open
response = meth(req, response)
File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 510, in error
return self._call_chain(*args)
File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/Users/imac/miniconda3/lib/python3.5/urllib/request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

@aarubui
Copy link

aarubui commented Apr 12, 2021

You seem anxious so here's a build of #28728 for *nix while you wait: youtube-dl_28728.zip

@FlaminHat
Copy link
Author

FlaminHat commented Apr 12, 2021

Not anxious so much, just keen with the encouragement of @bnw42 (thanks)

Output of what happens when I try the new youtube-dl you sent me (I have censored out the information that doesn't need to be made public)

/youtube-dl --username=*******@******.com --password=*************
 https://10play.com.au/news/sydney/sydney-news-01-apr-2021/tpv210401nupbd -o "Ten News Sydney, April 1.mp4" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--username=PRIVATE', '--password=PRIVATE', 'https://10play.com.au/news/sydney/sydney-news-01-apr-2021/tpv210401nupbd', '-o', 'Ten News Sydney, April 1.mp4', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.04.07
[debug] Python version 3.5.2 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Proxy map: {}
Traceback (most recent call last):
  File "/Users/imac/miniconda3/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/imac/miniconda3/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Items saved from being locked here/youtube-dl/__main__.py", line 19, in <module>
  File "/Items saved from being locked here/youtube-dl/youtube_dl/__init__.py", line 475, in main
  File "/Items saved from being locked here/youtube-dl/youtube_dl/__init__.py", line 465, in _real_main
  File "/Items saved from being locked here/youtube-dl/youtube_dl/YoutubeDL.py", line 2060, in download
  File "/Items saved from being locked here/youtube-dl/youtube_dl/YoutubeDL.py", line 799, in extract_info
  File "/Items saved from being locked here/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper
  File "/Items saved from being locked here/youtube-dl/youtube_dl/YoutubeDL.py", line 827, in __extract_info
  File "/Items saved from being locked here/youtube-dl/youtube_dl/extractor/common.py", line 533, in extract
  File "/Items saved from being locked here/youtube-dl/youtube_dl/extractor/common.py", line 437, in initialize
  File "/Items saved from being locked here/youtube-dl/youtube_dl/extractor/tenplay.py", line 62, in _real_initialize
  File "/Items saved from being locked here/youtube-dl/youtube_dl/extractor/tenplay.py", line 56, in _login
  File "/Users/imac/miniconda3/lib/python3.5/base64.py", line 59, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: a bytes-like object is required, not 'str'

@aarubui
Copy link

aarubui commented Apr 12, 2021

Thanks for testing for me. My changes only supported Python2.7. I've made the necessary changes for Python3.5. youtube-dl_28728_1.zip

@bnw42
Copy link

bnw42 commented Apr 12, 2021

Obviously not the windows executable, but there's no filetype, so unlike FlaminHat I have no idea what to do with the file. :(

@jmagic
Copy link

jmagic commented Apr 14, 2021

Tested this on python3.7 -- it works for me..

@Genesisfury
Copy link

Thanks for testing for me. My changes only supported Python2.7. I've made the necessary changes for Python3.5. youtube-dl_28728_1.zip

How do you use this fix?

@FlaminHat
Copy link
Author

@jmagic YES! This version works!

@Genesisfury In Terminal, drag and drop the file "youtube-dl" you unzipped from the zip, and enter the parameters like you normally use the "youtube-dl" command. It should come out in the Terminal as

/directory/containing/file/youtube-dl --username=....... etc. etc. --password=.......etc. etc. http://web.address.of.video -o "Video file.mp4"

@aarubui
Copy link

aarubui commented Apr 15, 2021

Probably just another person looking for the Windows build. If I had a heart, I would. Best they wait for the formal process of review, merge and release. May take extra long with being both geo-restricted and account-needed.

@Genesisfury
Copy link

Genesisfury commented Apr 15, 2021

Doesn't work. It gives me the password prompt "Type account password and press [Return]". When doing so, it returns with "ERROR" fixed output name but more than one file to download"

@bnw42
Copy link

bnw42 commented Apr 15, 2021

Running in terminal implies linux or maybe MacOS. Being a windows user, not much use. Still, the issue is in the works so I'm content to wait for the windoze exec to come out with the fix.

@Ronnnny
Copy link

Ronnnny commented Apr 15, 2021

I made the necessary edits thanks to aarubui, complied for windows and it's working for me.

@callatech2018
Copy link

Hi Ronnnny, could you please upload your Windows version for those of us who use the Windows one until this problem has been resolved.
Thanks

@Ronnnny
Copy link

Ronnnny commented Apr 16, 2021

use with -u "username" -p "password"
youtube-dl-10play-fix.zip

@bnw42
Copy link

bnw42 commented Apr 16, 2021

Works fine on Win10 .. but on Win7 this gives the dreaded "missing api-ms-win-core-path-l1-1-0.dll" error, which is an unresolvable error with win7 since the dll in question only works with Win8+. For Win7 it needs to be compiled with python 3.8.6 or earlier or as a 32-bit executable. :(

@Genesisfury
Copy link

Getting a Error 400: Bad request after it says "logging in". Any idea?

@bnw42
Copy link

bnw42 commented Apr 17, 2021

Worked fine for me on a Win10 pc. I assume you have a 10Play account?

The command line format is:
youtube-dl-10play-fix -u username -p password https://10play.com.au...

No quotes etc around username & password. When I created my 10play account, I had to put in an email address as the username. I did rename the exec patch as 10p.exe so there's less typing. :)

@Genesisfury
Copy link

Oh, I was putting a = after the -u and -p. It's working now. Thank you! I appreciate it.

@bnw42
Copy link

bnw42 commented Apr 17, 2021

I've found websites describing how to use the command line switches for youtube-dl to be somewhat contradictory. Some sites say to put in ='s before the username & password, others don't. I found by trial & error that the ='s are a no-no .. at least with windows.

@Ronnnny
Copy link

Ronnnny commented Apr 17, 2021

try this one on win7, no guarantees as I don't have win7 to test on.
youtube-dl-10plsy-fix-p3.6.zip

@bnw42
Copy link

bnw42 commented Apr 17, 2021

If you'll pardon a pun, it works a peach! Peach being one of the 10Play channels.
Thanks!!

@Nick-Barron
Copy link

This has fixed my issue - thank you!!! @aarubui

@ringofyre
Copy link

ringofyre commented Apr 25, 2021

The ver. provided by @Ronnnny does indeed work (with username and password) - could we get it pushed into master please?

@neilaja
Copy link

neilaja commented Jun 6, 2021

use with -u "username" -p "password"
youtube-dl-10play-fix.zip

This is brilliant. Worked beautifully. Thanks!

@2wenty2wo
Copy link

Thanks for testing for me. My changes only supported Python2.7. I've made the necessary changes for Python3.5. youtube-dl_28728_1.zip

Thank you! Works on macOS.

@Nick-Barron
Copy link

To update - this is still an issue on the latest version of youtube-dl so still using tis modified version

@bnw42
Copy link

bnw42 commented Dec 23, 2021

According to the changelog for the recent release, there were only a few issues addresses and those were attempted workarounds to get ty-dl working with youtube & porn hub. There were no fixes for 10play and no generic fixes (ie fixes that would apply to all sites).

Given the long queue of issues waiting to be dealt with and that 10play viewers are a small minority, it'll be a long time before this issue is addressed. I'd strongly recommend switching to a yt-dl fork such as yt-dlp. yt-dlp does work with the webpage urls for 10play, as long as you input a user name & password (which the modified version of yt-dl also requires).

@Nick-Barron
Copy link

Thank you @bnw42 I wasn't aware of yt-dlp

I will give it a go - really appreciate the help

@bnw42
Copy link

bnw42 commented Dec 23, 2021

I've been using yt-dlp for 6 months now. It's updated regularly. It does have additional features, but in the basic mode it works the same as yt-dl. So much so if you use a GUI, you can rename yt-dlp.exe as youtube-dl.exe and replace the obsolete yt-dl file in the GUI install. I know of a few users who tried that and it worked.

To get yt-dlp, go to this site (also on github): https://github.com/yt-dlp/yt-dlp

Scroll down to the "installation" section and download the relevant binary for your os. Like youtube-dl, once you have it on your computer, running "yt-dlp -u" will check for any updates & download the latest version, as with yt-dl.

@FlaminHat
Copy link
Author

I'm closing this thread because the question has been answered (user/pass required) and and yt-dlp provides additional answers to the problems.

Thankyou for your help with this issue.

@dirkf dirkf changed the title "403 Forbidden" error [10Play] "403 Forbidden" error Sep 16, 2022
@dirkf dirkf mentioned this issue Oct 21, 2022
6 tasks
@Vangelis66 Vangelis66 mentioned this issue Mar 24, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

17 participants