jely2002 / youtube-dl-gui

A cross-platform GUI for youtube-dl made in Electron and node.js
GNU Affero General Public License v3.0
6.4k stars 438 forks source link

Is it possible to download Instagram videos? #488

Open artquest opened 1 year ago

artquest commented 1 year ago

I tried and got an error:

{
  "shortMessage": "Command failed with exit code 1: C:\\Users\\%username%\\AppData\\Local\\Programs\\youtube-dl-gui\\resources\\app.asar.unpacked\\binaries\\yt-dlp.exe -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 --no-check-certificate --yes-playlist https://www.instagram.com/p/CntImexBpVZ/",
  "command": "C:\\Users\\%username%\\AppData\\Local\\Programs\\youtube-dl-gui\\resources\\app.asar.unpacked\\binaries\\yt-dlp.exe -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 --no-check-certificate --yes-playlist https://www.instagram.com/p/CntImexBpVZ/",
  "exitCode": 1,
  "stdout": "null",
  "stderr": "WARNING: [Instagram] CntImexBpVZ: No csrf token set by Instagram API\nWARNING: [Instagram] CntImexBpVZ: General metadata extraction failed (some metadata might be missing).\nERROR: [Instagram] CntImexBpVZ: Unable to download webpage: <urlopen error [Errno 11002] getaddrinfo failed> (caused by URLError(gaierror(11002, 'getaddrinfo failed')))",
  "failed": true,
  "timedOut": false,
  "isCanceled": false,
  "killed": false
}
StefanLobbenmeier commented 1 year ago

yt-dlp (which is the underlying downloader this project uses) supports it. Can you check that you are using the latest version of it? Not sure if you applied it manually, but maybe some time has passed since then.

image

artquest commented 1 year ago

Hi, I have version 2023.3.4.0, and if I get it right, the Downloader updates yt-dlp automatically (I see the updating regularly in its address bar). About Instagram, it's blocked by Russian government (and I'm in Russia), so I can connect to it only through a proxy and additionally using some "hacks" in the browser. I tried to use some other free proxy inside the Downloader, and it does connect (I tested some YouTube videos), but again failed on Instagram, but with a new error. If I get it right, a cookie or credentials need to be passed to yt-dlp.

{
  "shortMessage": "Command failed with exit code 1: C:\\Users\\%username%\\AppData\\Local\\Programs\\youtube-dl-gui\\resources\\app.asar.unpacked\\binaries\\yt-dlp.exe -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36 --proxy https://8.219.176.202:8080 --no-check-certificate --yes-playlist https://www.instagram.com/p/CrD4XO9ukIW/",
  "command": "C:\\Users\\%username%\\AppData\\Local\\Programs\\youtube-dl-gui\\resources\\app.asar.unpacked\\binaries\\yt-dlp.exe -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36 --proxy https://8.219.176.202:8080 --no-check-certificate --yes-playlist https://www.instagram.com/p/CrD4XO9ukIW/",
  "exitCode": 1,
  "stdout": "null",
  "stderr": "WARNING: [Instagram] CrD4XO9ukIW: General metadata extraction failed (some metadata might be missing).\nWARNING: [Instagram] unable to extract shared data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U\nWARNING: [Instagram] Main webpage is locked behind the login page. Retrying with embed webpage (some metadata might be missing).\nWARNING: [Instagram] unable to extract additional data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U\nERROR: [Instagram] CrD4XO9ukIW: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, or --netrc (instagram) to provide account credentials",
  "failed": true,
  "timedOut": false,
  "isCanceled": false,
  "killed": false
}
StefanLobbenmeier commented 1 year ago

At least the new error shows that instagram is blocking the Download:

[Instagram] CrD4XO9ukIW: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, or --netrc (instagram) to provide account credentials",

if you can login from the browser, the open video downloader allows you to put in cookies (it’s the key button I think). But it could also be that instagram is blocking the download because many people are using that proxy server to access instagram

artquest commented 1 year ago

I added the cookie txt (using Get cookies.txt LOCALLY extension) and the video finally was properly inserted in the queue (I got a name and description) but was unable to download it, but it's probably because this free proxy is too slow. I think the problem is solved, I just need to find a new working proxy. Thank you!