Open azowrle opened 9 months ago
The Google Drive website sets a session cookie that grants you access to the direct download link. When you find the link in your browser's dev tools, the cookie has been set in your browser, so the direct download link works.
When you copy the link from yt-dlp, your browser does not have the cookie set that yt-dlp has. From the JSON output in your log:
"cookies": "DRIVE_STREAM=ihdde9PlARw; Domain=.drive.google.com; Path=/; Secure"
The Google Drive website sets a session cookie that grants you access to the direct download link. When you find the link in your browser's dev tools, the cookie has been set in your browser, so the direct download link works.
When you copy the link from yt-dlp, your browser does not have the cookie set that yt-dlp has. From the JSON output in your log:
"cookies": "DRIVE_STREAM=ihdde9PlARw; Domain=.drive.google.com; Path=/; Secure"
Hey thank you for your answer. I did try before and I can confirm that by me setting the cookies I can get a successful response. My issue was the need to set the cookies in the first place.
Grabbing the URL from my network tab and pasting it in a new incognito window does work without having any cookies. Even looking at the URL is very different from the one that I am getting from yt-dlp as it has some additional parameters:
"&cpn=oyjwgn5ZeEVrcnyn&c=WEB_EMBEDDED_PLAYER&cver=1.20240220.01.00"
So I am guessing yt-dlp does not extract the URL the player is using, thus it makes it unplayable in the browser.
Maybe I can pass some additional parameters to yt-dlp to make the URL playable without the need for cookies?
Grabbing the URL from my network tab and pasting it in a new incognito window does work without having any cookies. Even looking at the URL is very different from the one that I am getting from yt-dlp as it has some additional parameters:
"&cpn=oyjwgn5ZeEVrcnyn&c=WEB_EMBEDDED_PLAYER&cver=1.20240220.01.00"
Ah, my bad, I was unaware. Interesting
Maybe I can pass some additional parameters to yt-dlp to make the URL playable without the need for cookies?
No, you would need to edit/rewrite the extractor (or write an extractor override plugin)
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Region
Australia
Provide a description that is worded well enough to be understood
Hi guys! I am trying to extract JSON data from the Google Drive video link, and when I try to use the format direct URL, the video does not stream directly in the browser. I am just getting: "Access to [endpoint].c.drive.google.com was denied"
Visiting the link and streaming it in the browser using their player works. Also, if I grab the link that their player is using to stream the video from the "Network" tab in Google Chrome and open it in another tab, it will work (stream in the browser).
I think the extractor is broken in some way that does not produce the same link as the one I am getting from the player. Maybe I need to pass some extra args to achieve my goal?
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output