403 Forbidden Error #25346

Closed
opened 2026-02-21 12:29:10 -05:00 by deekerman · 9 comments
Owner
Originally created by @SARIBEG10 on GitHub (Jul 2, 2022). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions - Search the bugtracker for similar questions: http://yt-dl.org/search-issues - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm asking a question - [x] I've looked through the README and FAQ for similar questions - [x] I've searched the bugtracker for similar questions including closed ones ## Question get 403 HTTP Forbidden Error during try download this link --> https://rr5---sn-npoe7n7r.googlevideo.com/videoplayback?expire=1656514949&ei=JRW8YpL4H6aB4-EPldSfuAs&ip=51.79.223.96&id=o-ACOYZY9OIZIrMeWC29ren3bCKQUT43rtkUmu8OMs4aKG&itag=22&source=youtube&requiressl=yes&mh=QP&mm=31%2C29&mn=sn-npoe7n7r%2Csn-npoldn7s&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=160000&spc=4ocVCwhhRmfthjV_48ipGlGXjBzv3gU&vprv=1&mime=video%2Fmp4&ns=wQQYzQsLf0WcaFQHeS00GfIG&cnr=14&ratebypass=yes&dur=177.748&lmt=1635032556535869&mt=1656492556&fvip=1&fexp=24001373%2C24007246&c=WEB&txp=6311224&n=mYtKyDg8RdAhOtO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPOWuNTzsZWEnYQQDG7B6UP8AXkjlT50zqKAkpki6hLvAiBQpqnBVKA4TF7bER7V2CQLSEhMtT8v5vBsl19L0KMLzA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbuwb5C3LOyWJRl7rvnOnzcsxL2DodZnSCMOaeqEZ5OQCIQC1-GIs4LNc_prpgXEaIpN6BKG6hqpOUhhegZUN3bBl3A%3D%3D
deekerman 2026-02-21 12:29:10 -05:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@gamer191 commented on GitHub (Jul 2, 2022):

Why are you trying to download a youtube direct link? Why not just use the youtube.com link?

@gamer191 commented on GitHub (Jul 2, 2022): Why are you trying to download a youtube direct link? Why not just use the `youtube.com` link?
Author
Owner

@SARIBEG10 commented on GitHub (Jul 2, 2022):

I've extracted channel infos from youtube.com/{channelid}/videos link then try to extract and download from above link

@SARIBEG10 commented on GitHub (Jul 2, 2022): I've extracted channel infos from youtube.com/{channelid}/videos link then try to extract and download from above link
Author
Owner

@gamer191 commented on GitHub (Jul 2, 2022):

@SARIBEG10 I don't what "channel info" you're talking about, but that's fine. Anyway, when did you extract the info above link?

EDIT: changed "info" to "above link"

@gamer191 commented on GitHub (Jul 2, 2022): @SARIBEG10 I don't what "channel info" you're talking about, but that's fine. Anyway, when did you extract the ~~info~~ above link? EDIT: changed "info" to "above link"
Author
Owner

@SARIBEG10 commented on GitHub (Jul 2, 2022):

curl -I -v -x 'http://192.168.5.91:8118' "https://rr5---sn-npoe7n7r.googlevideo.com/videoplayback?expire=1656514949&ei=JRW8YpL4H6aB4-EPldSfuAs&ip=51.79.223.96&id=o-ACOYZY9OIZIrMeWC29ren3bCKQUT43rtkUmu8OMs4aKG&itag=22&source=youtube&requiressl=yes&mh=QP&mm=31%2C29&mn=sn-npoe7n7r%2Csn-npoldn7s&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=160000&spc=4ocVCwhhRmfthjV_48ipGlGXjBzv3gU&vprv=1&mime=video%2Fmp4&ns=wQQYzQsLf0WcaFQHeS00GfIG&cnr=14&ratebypass=yes&dur=177.748&lmt=1635032556535869&mt=1656492556&fvip=1&fexp=24001373%2C24007246&c=WEB&txp=6311224&n=mYtKyDg8RdAhOtO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPOWuNTzsZWEnYQQDG7B6UP8AXkjlT50zqKAkpki6hLvAiBQpqnBVKA4TF7bER7V2CQLSEhMtT8v5vBsl19L0KMLzA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbuwb5C3LOyWJRl7rvnOnzcsxL2DodZnSCMOaeqEZ5OQCIQC1-GIs4LNc_prpgXEaIpN6BKG6hqpOUhhegZUN3bBl3A%3D%3D"

  • Trying 192.168.5.91...
  • TCP_NODELAY set
  • Connected to 192.168.5.91 (192.168.5.91) port 8118 (#0)
  • allocate connect buffer!
  • Establish HTTP proxy tunnel to rr5---sn-npoe7n7r.googlevideo.com:443

CONNECT rr5---sn-npoe7n7r.googlevideo.com:443 HTTP/1.1
Host: rr5---sn-npoe7n7r.googlevideo.com:443
User-Agent: curl/7.58.0
Proxy-Connection: Keep-Alive

< HTTP/1.1 200 Connection established
HTTP/1.1 200 Connection established
< Connection: close
Connection: close
<

  • Proxy replied 200 to CONNECT request
  • CONNECT phase completed!
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: /etc/ssl/certs
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • CONNECT phase completed!
  • CONNECT phase completed!
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
  • TLSv1.3 (IN), TLS handshake, Unknown (8):
  • TLSv1.3 (IN), TLS handshake, Certificate (11):
  • TLSv1.3 (IN), TLS handshake, CERT verify (15):
  • TLSv1.3 (IN), TLS handshake, Finished (20):
  • TLSv1.3 (OUT), TLS change cipher, Client hello (1):
  • TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
  • TLSv1.3 (OUT), TLS handshake, Finished (20):
  • SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
  • ALPN, server did not agree to a protocol
  • Server certificate:
  • subject: CN=*.c.docs.google.com
  • start date: Jun 21 11:05:53 2022 GMT
  • expire date: Aug 30 11:05:52 2022 GMT
  • subjectAltName: host "rr5---sn-npoe7n7r.googlevideo.com" matched cert's "*.googlevideo.com"
  • issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
  • SSL certificate verify ok.
  • TLSv1.3 (OUT), TLS Unknown, Unknown (23):

HEAD /videoplayback?expire=1656514949&ei=JRW8YpL4H6aB4-EPldSfuAs&ip=51.79.223.96&id=o-ACOYZY9OIZIrMeWC29ren3bCKQUT43rtkUmu8OMs4aKG&itag=22&source=youtube&requiressl=yes&mh=QP&mm=31%2C29&mn=sn-npoe7n7r%2Csn-npoldn7s&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=160000&spc=4ocVCwhhRmfthjV_48ipGlGXjBzv3gU&vprv=1&mime=video%2Fmp4&ns=wQQYzQsLf0WcaFQHeS00GfIG&cnr=14&ratebypass=yes&dur=177.748&lmt=1635032556535869&mt=1656492556&fvip=1&fexp=24001373%2C24007246&c=WEB&txp=6311224&n=mYtKyDg8RdAhOtO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPOWuNTzsZWEnYQQDG7B6UP8AXkjlT50zqKAkpki6hLvAiBQpqnBVKA4TF7bER7V2CQLSEhMtT8v5vBsl19L0KMLzA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbuwb5C3LOyWJRl7rvnOnzcsxL2DodZnSCMOaeqEZ5OQCIQC1-GIs4LNc_prpgXEaIpN6BKG6hqpOUhhegZUN3bBl3A%3D%3D HTTP/1.1
Host: rr5---sn-npoe7n7r.googlevideo.com
User-Agent: curl/7.58.0
Accept: /

  • TLSv1.3 (IN), TLS Unknown, Unknown (23):
    < HTTP/1.1 403 Forbidden
    HTTP/1.1 403 Forbidden
    < Last-Modified: Wed, 02 May 2007 10:26:10 GMT
    Last-Modified: Wed, 02 May 2007 10:26:10 GMT
    < Content-Type: text/plain
    Content-Type: text/plain
    < Content-Length: 0
    Content-Length: 0
    < Connection: close
    Connection: close
    < Vary: Origin
    Vary: Origin
    < Cross-Origin-Resource-Policy: cross-origin
    Cross-Origin-Resource-Policy: cross-origin
    < X-Content-Type-Options: nosniff
    X-Content-Type-Options: nosniff
    < Date: Sat, 02 Jul 2022 13:54:22 GMT
    Date: Sat, 02 Jul 2022 13:54:22 GMT
    < Server: gvs 1.0
    Server: gvs 1.0

<

  • Closing connection 0
  • TLSv1.3 (OUT), TLS Unknown, Unknown (21):
  • TLSv1.3 (OUT), TLS alert, Client hello (1):

this is the output of curl HEAD request

@SARIBEG10 commented on GitHub (Jul 2, 2022): curl -I -v -x 'http://192.168.5.91:8118' "https://rr5---sn-npoe7n7r.googlevideo.com/videoplayback?expire=1656514949&ei=JRW8YpL4H6aB4-EPldSfuAs&ip=51.79.223.96&id=o-ACOYZY9OIZIrMeWC29ren3bCKQUT43rtkUmu8OMs4aKG&itag=22&source=youtube&requiressl=yes&mh=QP&mm=31%2C29&mn=sn-npoe7n7r%2Csn-npoldn7s&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=160000&spc=4ocVCwhhRmfthjV_48ipGlGXjBzv3gU&vprv=1&mime=video%2Fmp4&ns=wQQYzQsLf0WcaFQHeS00GfIG&cnr=14&ratebypass=yes&dur=177.748&lmt=1635032556535869&mt=1656492556&fvip=1&fexp=24001373%2C24007246&c=WEB&txp=6311224&n=mYtKyDg8RdAhOtO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPOWuNTzsZWEnYQQDG7B6UP8AXkjlT50zqKAkpki6hLvAiBQpqnBVKA4TF7bER7V2CQLSEhMtT8v5vBsl19L0KMLzA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbuwb5C3LOyWJRl7rvnOnzcsxL2DodZnSCMOaeqEZ5OQCIQC1-GIs4LNc_prpgXEaIpN6BKG6hqpOUhhegZUN3bBl3A%3D%3D" * Trying 192.168.5.91... * TCP_NODELAY set * Connected to 192.168.5.91 (192.168.5.91) port 8118 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to rr5---sn-npoe7n7r.googlevideo.com:443 > CONNECT rr5---sn-npoe7n7r.googlevideo.com:443 HTTP/1.1 > Host: rr5---sn-npoe7n7r.googlevideo.com:443 > User-Agent: curl/7.58.0 > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 Connection established HTTP/1.1 200 Connection established < Connection: close Connection: close < * Proxy replied 200 to CONNECT request * CONNECT phase completed! * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * CONNECT phase completed! * CONNECT phase completed! * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.3 (IN), TLS Unknown, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Unknown (8): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Client hello (1): * TLSv1.3 (OUT), TLS Unknown, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: CN=*.c.docs.google.com * start date: Jun 21 11:05:53 2022 GMT * expire date: Aug 30 11:05:52 2022 GMT * subjectAltName: host "rr5---sn-npoe7n7r.googlevideo.com" matched cert's "*.googlevideo.com" * issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3 * SSL certificate verify ok. * TLSv1.3 (OUT), TLS Unknown, Unknown (23): > HEAD /videoplayback?expire=1656514949&ei=JRW8YpL4H6aB4-EPldSfuAs&ip=51.79.223.96&id=o-ACOYZY9OIZIrMeWC29ren3bCKQUT43rtkUmu8OMs4aKG&itag=22&source=youtube&requiressl=yes&mh=QP&mm=31%2C29&mn=sn-npoe7n7r%2Csn-npoldn7s&ms=au%2Crdu&mv=m&mvi=5&pl=24&initcwndbps=160000&spc=4ocVCwhhRmfthjV_48ipGlGXjBzv3gU&vprv=1&mime=video%2Fmp4&ns=wQQYzQsLf0WcaFQHeS00GfIG&cnr=14&ratebypass=yes&dur=177.748&lmt=1635032556535869&mt=1656492556&fvip=1&fexp=24001373%2C24007246&c=WEB&txp=6311224&n=mYtKyDg8RdAhOtO&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Cmime%2Cns%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPOWuNTzsZWEnYQQDG7B6UP8AXkjlT50zqKAkpki6hLvAiBQpqnBVKA4TF7bER7V2CQLSEhMtT8v5vBsl19L0KMLzA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgbuwb5C3LOyWJRl7rvnOnzcsxL2DodZnSCMOaeqEZ5OQCIQC1-GIs4LNc_prpgXEaIpN6BKG6hqpOUhhegZUN3bBl3A%3D%3D HTTP/1.1 > Host: rr5---sn-npoe7n7r.googlevideo.com > User-Agent: curl/7.58.0 > Accept: */* > * TLSv1.3 (IN), TLS Unknown, Unknown (23): < HTTP/1.1 403 Forbidden HTTP/1.1 403 Forbidden < Last-Modified: Wed, 02 May 2007 10:26:10 GMT Last-Modified: Wed, 02 May 2007 10:26:10 GMT < Content-Type: text/plain Content-Type: text/plain < Content-Length: 0 Content-Length: 0 < Connection: close Connection: close < Vary: Origin Vary: Origin < Cross-Origin-Resource-Policy: cross-origin Cross-Origin-Resource-Policy: cross-origin < X-Content-Type-Options: nosniff X-Content-Type-Options: nosniff < Date: Sat, 02 Jul 2022 13:54:22 GMT Date: Sat, 02 Jul 2022 13:54:22 GMT < Server: gvs 1.0 Server: gvs 1.0 < * Closing connection 0 * TLSv1.3 (OUT), TLS Unknown, Unknown (21): * TLSv1.3 (OUT), TLS alert, Client hello (1): this is the output of curl HEAD request
Author
Owner

@SARIBEG10 commented on GitHub (Jul 2, 2022):

bind the proxy to my localhost address as you see 192.168.5.91:8118

@SARIBEG10 commented on GitHub (Jul 2, 2022): bind the proxy to my localhost address as you see 192.168.5.91:8118
Author
Owner

@dirkf commented on GitHub (Jul 2, 2022):

See #29911.

Try this somewhere where the proxy isn't required.

Because the download links supplied by sites like YT expire, you can't have a workflow that extracts a download link for each video in the channel and then downloads each link in turn. Instead, extract a preferred format_id, which is usually stable, and then use that for each download; obviously but unavoidably, each video page has to be extracted just before the video download.

@dirkf commented on GitHub (Jul 2, 2022): See #29911. Try this somewhere where the proxy isn't required. Because the download links supplied by sites like YT expire, you can't have a workflow that extracts a download link for each video in the channel and then downloads each link in turn. Instead, extract a preferred `format_id`, which is usually stable, and then use that for each download; obviously but unavoidably, each video page has to be extracted just before the video download.
Author
Owner

@SARIBEG10 commented on GitHub (Jul 3, 2022):

this link is expired you right i try to generate new link ==> youtube-dl --proxy=http://localhost:8118 -f 136 -g https://www.youtube.com/watch?v={vid}
then get generated link by :

curl -w '%{http_code}' -L -x http://localhost:8118 [generated_link]

then its return 200 http status code

@SARIBEG10 commented on GitHub (Jul 3, 2022): this link is expired you right i try to generate new link ==> youtube-dl --proxy=http://localhost:8118 -f 136 -g https://www.youtube.com/watch\?v\={vid} then get generated link by : curl -w '%{http_code}' -L -x http://localhost:8118 [generated_link] then its return 200 http status code
Author
Owner

@SARIBEG10 commented on GitHub (Jul 3, 2022):

you first check the generated link on browser and assure that link unexpired then try to download it

@SARIBEG10 commented on GitHub (Jul 3, 2022): you first check the generated link on browser and assure that link unexpired then try to download it
Author
Owner

@dirkf commented on GitHub (Jul 3, 2022):

Almost always 403 for a download link is because it has expired, so you can just test that with curl -I ... and re-run yt-dl to get a fresh link, or indeed actually download from it.

yt-dl has some features that might help in archiving your channel:

  • --download-archive ... records downloaded items so thatthey don't get downloaded twice
  • playlist-items ... (etc) allow you to download only certain items from a playlist or channel.
    More in the Manual.
@dirkf commented on GitHub (Jul 3, 2022): Almost always 403 for a download link is because it has expired, so you can just test that with `curl -I ...` and re-run yt-dl to get a fresh link, or indeed actually download from it. yt-dl has some features that might help in archiving your channel: * `--download-archive ...` records downloaded items so thatthey don't get downloaded twice * `playlist-items ...` (etc) allow you to download only certain items from a playlist or channel. [More in the Manual](https://github.com/ytdl-org/youtube-dl#user-content-options).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#25346
No description provided.