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

can not download instagram video #26377

Open
qiufeihai opened this issue Aug 19, 2020 · 14 comments
Open

can not download instagram video #26377

qiufeihai opened this issue Aug 19, 2020 · 14 comments

Comments

@qiufeihai
Copy link

@qiufeihai qiufeihai commented Aug 19, 2020

youtube-dl version

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 3.8.0 (CPython) - Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-glibc2.17
[debug] exe versions: none
[debug] Proxy map: {}
Usage: youtube-dl [OPTIONS] URL [URL...]

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'mp4', '-o', 'test.mp4', 'https://www.instagram.com/p/CECsuu2BgXj/?utm_source=ig_web_copy_link', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 3.8.0 (CPython) - Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-glibc2.17
[debug] exe versions: none
[debug] Proxy map: {}
[Instagram] CECsuu2BgXj: 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/instagram.py", line 195, in _real_extract
    video_url = self._og_search_video_url(webpage, secure=False)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1123, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1014, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1005, 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

can not download instagram video

WRITE DESCRIPTION HERE

@Runiko
Copy link

@Runiko Runiko commented Aug 19, 2020

I can't reproduce this issue. I'm not really sure, but it looks like you don't have a ffmpeg binary on your system, so please make sure it's installed and try again.

yt-dl -v -f mp4 -o "test.mp4" https://www.instagram.com/p/CECsuu2BgXj/?utm_source=ig_web_copy_link
[debug] System config: []
[debug] User config: ['-o', '%(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['-v', '-f', 'mp4', '-o', 'test.mp4', 'https://www.instagram.com/p/CECsuu2BgXj/?utm_source=ig_web_copy_link']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 3.8.5 (CPython) - Linux-5.8.0-2-MANJARO-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Proxy map: {}
[Instagram] CECsuu2BgXj: Downloading webpage
[debug] Invoking downloader on 'URL'
[download] Destination: test.mp4
[download] 100% of 4.60MiB in 00:00
@qiufeihai
Copy link
Author

@qiufeihai qiufeihai commented Aug 21, 2020

after install ffmpeg

youtube-dl -f mp4 -o test.mp4 https://www.instagram.com/p/CECsuu2BgXj/?utm_source=ig_web_copy_link -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'mp4', '-o', 'test.mp4', 'https://www.instagram.com/p/CECsuu2BgXj/?utm_source=ig_web_copy_link', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 3.8.0 (CPython) - Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-glibc2.17
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8
[debug] Proxy map: {}
[Instagram] CECsuu2BgXj: 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/instagram.py", line 195, in _real_extract
    video_url = self._og_search_video_url(webpage, secure=False)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1123, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1014, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1005, 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@jjhesk
Copy link

@jjhesk jjhesk commented Aug 21, 2020

try other library

@ilyailya
Copy link

@ilyailya ilyailya commented Sep 13, 2020

I have the same issue.
Oddly it works on my personal macbook, but don't work on a server:

# youtube-dl --verbose https://www.instagram.com/p/CFC897ECPrJ/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.instagram.com/p/CFC897ECPrJ/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Git HEAD: 9886d18
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-66-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8
[debug] Proxy map: {}
[Instagram] CFC897ECPrJ: 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 "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/extractor/instagram.py", line 195, in _real_extract
    video_url = self._og_search_video_url(webpage, secure=False)
  File "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1123, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1014, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/root/redditbot/venv/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 1005, 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.
@ilyailya
Copy link

@ilyailya ilyailya commented Sep 13, 2020

Here is output from mac:

» youtube-dl --verbose https://www.instagram.com/p/CFC897ECPrJ/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.instagram.com/p/CFC897ECPrJ/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Git HEAD: 24acfa3
[debug] Python version 3.7.6 (CPython) - Darwin-18.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.3.1, ffprobe 3.3.1
[debug] Proxy map: {}
[Instagram] CFC897ECPrJ: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent-dub4-1.cdninstagram.com/v/t50.2886-16/119474664_314554919773092_2942774456573139959_n.mp4?_nc_ht=scontent-dub4-1.cdninstagram.com&_nc_cat=100&_nc_ohc=JtSyshgqdgMAX9XeMTz&oe=5F5F899C&oh=01e1bb8c361ba139886f90a9bb155619'
[download] Destination: Video by world_of_snakes-CFC897ECPrJ.mp4
[download] 100% of 1009.31KiB in 00:00
@ilyailya
Copy link

@ilyailya ilyailya commented Sep 13, 2020

I already tried to upgrade to the newer version of youtube-dl, it didn't help

@llacb47
Copy link

@llacb47 llacb47 commented Sep 13, 2020

Oddly it works on my personal macbook, but don't work on a server

Maybe instagram is rate limiting your server, or serving different content to its IP. What's the output of curl https://www.instagram.com/p/CFC897ECPrJ/ if you run it from your server? You can put it in a pastebin/gist

@ilyailya
Copy link

@ilyailya ilyailya commented Sep 13, 2020

@llacb47 That's actually a super smart guess!
https://gist.github.com/ilyailya/2b15d259f3f6268353380da4d7e4e7a6
Turns out instagram redirecting me to the login page

@Runiko
Copy link

@Runiko Runiko commented Sep 13, 2020

Could it be something related to TLS verification?

While in my case every handshake is made properly, in case of @ilyailya there are some outputs like * TLSv1.3 (IN), TLS handshake, Unknown (8): in line 14 and * TLSv1.3 (IN), TLS Unknown, Certificate Status (22): in line 45, and that's where 302 redirection occurs.

@llacb47
Copy link

@llacb47 llacb47 commented Sep 13, 2020

Could it be something related to TLS verification?

No. It's rate-limiting, plain and simple. If you log in to instagram from your server's ip (even if you then log out), it should not happen anymore

@ilyailya
Copy link

@ilyailya ilyailya commented Sep 13, 2020

If you log in to instagram from your server's ip (even if you then log out), it should not happen anymore

@llacb47 I'm having a hard time imagining how to do it, do you have any ideas?

@dtunctuncer
Copy link

@dtunctuncer dtunctuncer commented Sep 23, 2020

@ilyailya Have you found a solution? I am also having the same issue

@ilyailya
Copy link

@ilyailya ilyailya commented Sep 23, 2020

@dtunctuncer, unfortunately, not. I've tried authorising through this lib https://github.com/ping/instagram_private_api, but it didn't help. If you will find solution, pls post it here

@blacklion
Copy link

@blacklion blacklion commented Oct 13, 2020

I could not download video s IGTV too (I could see it in browser):

> ./youtube-dl --verbose 'https://www.instagram.com/tv/CGIPlKQqaU6/'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.instagram.com/tv/CGIPlKQqaU6/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.7.7 (CPython) - FreeBSD-12.1-STABLE-amd64-64bit-ELF
[debug] exe versions: ffmpeg 4.2.3, ffprobe 4.2.3
[debug] Proxy map: {}
[Instagram] CGIPlKQqaU6: 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "./youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "./youtube-dl/youtube_dl/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "./youtube-dl/youtube_dl/extractor/instagram.py", line 195, in _real_extract
    video_url = self._og_search_video_url(webpage, secure=False)
  File "./youtube-dl/youtube_dl/extractor/common.py", line 1128, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "./youtube-dl/youtube_dl/extractor/common.py", line 1019, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "./youtube-dl/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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.