ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.16k stars 10.03k forks source link

ERROR: You don't have permission to access this video. #27907

Closed Nishit-Dua closed 11 months ago

Nishit-Dua commented 3 years ago

Checklist

Verbose log

sudo youtube-dl -v -u f20180620@goa.bits-pilani.ac.in -p $MYPASSWORD https://drive.google.com/file/d/1bl2iBUDkkfcA3I8ffE8S11VrDiwwW3Kk/view
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-u', 'PRIVATE', '-p', 'PRIVATE', 'https://drive.google.com/file/d/1bl2iBUDkkfcA3I8ffE8S11VrDiwwW3Kk/view']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.01.16
[debug] Python version 3.8.5 (CPython) - Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Proxy map: {}
[GoogleDrive] 1bl2iBUDkkfcA3I8ffE8S11VrDiwwW3Kk: Downloading webpage
ERROR: You don't have permission to access this video.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 805, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/YoutubeDL.py", line 826, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/googledrive.py", line 175, in _real_extract
    raise ExtractorError(reason, expected=True)
youtube_dl.utils.ExtractorError: You don't have permission to access this video.

Description

Hi I tried to Download lectures from Gdrive where my Uni uploads it. It Threw ERROR: You don't have permission to access this video. at me i have no damn clue, Sorry i can't provide my uni credentials and i have no work around this but i assure you the password i entered is the correct password and i can view the video is browser.

Harshkumar77 commented 2 years ago

any update i have to download from private drive ?

quannle commented 11 months ago

If you are able to access the video from a private drive via google (i.e. you can open the webpage and view it but can't download), what you can try is using your cookies.

Export your cookies and download them using a browser extension (e.g. "Get Cookies.txt" for Google Chrome) and then pass the cookies onto youtube-dl

youtube-dl --cookies <path to cookies> <url>

dirkf commented 11 months ago

Use the extension shown in the FAQ. Unfortunately site login procedures are prone to change and be broken by Captcha (etc) protection, making it unlikely that passing username+password to yt-dl will work, but cookies will generally succeed. It may be necessary to send headers that match the browser where the cookies were set (eg User-agent), but not with YouTube AFAIK.