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

Cookies for Instagram not working #27422

Closed
5 tasks done
smnthermes opened this issue Dec 13, 2020 · 1 comment
Closed
5 tasks done

Cookies for Instagram not working #27422

smnthermes opened this issue Dec 13, 2020 · 1 comment

Comments

@smnthermes
Copy link

smnthermes commented Dec 13, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.12.14
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

youtube-dl --verbose --cookies /home/tim/Documentos/cookies.txt https://instagram.com/p/aye83DjauH/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--cookies', '/home/tim/Documentos/cookies.txt', 'https://instagram.com/p/aye83DjauH/']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.12.14
[debug] Python version 3.8.5 (CPython) - Linux-5.4.0-58-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4
[debug] Proxy map: {}
[Instagram] aye83DjauH: Downloading webpage
ERROR: Unable to extract video url; 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.
Traceback (most recent call last):
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 803, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 824, in __extract_info
    ie_result = ie.extract(url)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/extractor/instagram.py", line 195, in _real_extract
    video_url = self._og_search_video_url(webpage, secure=False)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 1128, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 1019, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/home/tim/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 1010, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract video url; 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.

Description

EDIT: The video is public, but Instagram blocks VPN or Tor if not logged in.
I used a cookies.txt file generated by the Firefox extension mentioned in README.md:

# Netscape HTTP Cookie File
# https://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file! Do not edit.

#HttpOnly_.instagram.com	TRUE	/	TRUE	1670969703	ig_did	63C9A59C-B283-4A86-A59F-0F54D3D892C9
.instagram.com	TRUE	/	TRUE	1639433703	ig_nrcb	1
.instagram.com	TRUE	/	TRUE	1670969703	mid	X9aSZwAEAAGTRatw-HhQSiWT0ad4
#HttpOnly_.instagram.com	TRUE	/	TRUE	0	rur	FRC
#HttpOnly_.instagram.com	TRUE	/	TRUE	1639433717	sessionid	41350652408%3ApctTdR5YAduwKK%3A11
.instagram.com	TRUE	/	TRUE	1639347323	csrftoken	217h7kyTQfEViXVOUCzHwzbjSOYa4D0d
.instagram.com	TRUE	/	TRUE	1615673723	ds_user_id	41350652408
#HttpOnly_.instagram.com	TRUE	/	TRUE	0	urlgen	"{\"191.189.237.226\": 28573}:1koZeF:FfvxP483Z-SaQIMB3XDXTNTf4hE"

cookies.txt file after being modified by youtube-dl:

# Netscape HTTP Cookie File
# This file is generated by youtube-dl.  Do not edit.

.instagram.com	TRUE	/	TRUE	1639348003	csrftoken	217h7kyTQfEViXVOUCzHwzbjSOYa4D0d
.instagram.com	TRUE	/	TRUE	1615674403	ds_user_id	41350652408
.instagram.com	TRUE	/	TRUE	1670969703	ig_did	63C9A59C-B283-4A86-A59F-0F54D3D892C9
.instagram.com	TRUE	/	TRUE	1639433703	ig_nrcb	1
.instagram.com	TRUE	/	TRUE	1670969703	mid	X9aSZwAEAAGTRatw-HhQSiWT0ad4
.instagram.com	TRUE	/	TRUE	0	rur	FRC
.instagram.com	TRUE	/	TRUE	1639433717	sessionid	41350652408%3ApctTdR5YAduwKK%3A11
.instagram.com	TRUE	/	TRUE	0	urlgen	"{\"191.189.237.226\": 28573}:1koZpC:Tk6OuEr4mAOX8oUbyvz8LD-4H0o"
@ytdl-org ytdl-org deleted a comment Dec 26, 2020
@dstftw dstftw closed this as completed in 58e5519 Dec 26, 2020
@xihuny
Copy link

xihuny commented Jan 17, 2021

Not working for me either. How to solve this issue?

ThirumalaiK pushed a commit to ThirumalaiK/youtube-dl that referenced this issue Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants