无法使用 youtube-dl 在虚拟专用服务器 (VPS) 上下载 Instagram 视频

问题描述

我尝试使用 youtube-dl 在我的 VPS (ubuntu) 上下载 Instagram 视频,但它不起作用。我尝试下载 YouTube 视频,效果很好。我也尝试过使用 you-get 而不是 youtube-dl,但它也不适用于 Instagram,但它确实适用于 youtube。我也尝试过使用 cookie,但没有用。

我使用的托管服务是 goormide

这是我使用 --verbose 时的完整输出

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose','https://www.instagram.com/p/CM2UPLWIJZa/']
[debug] Encodings: locale UTF-8,fs utf-8,out UTF-8,pref UTF-8
[debug] youtube-dl version 2021.03.25
[debug] Python version 3.7.4 (cpython) - Linux-4.4.0-1124-aws-x86_64-with-debian-buster-sid
[debug] exe versions: none
[debug] Proxy map: {}
[Instagram] CM2UPLWIJZa: 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  h
ttps://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 "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubedL.py",line 806,in wrapper
    return func(self,*args,**kwargs)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubedL.py",line 827,in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py",line 534,in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/instagram.py",line 216,in _real_extract
    video_url = self._og_search_video_url(webpage,secure=False)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py",line 1130,in _og_search_video_url
    return self._html_search_regex(regexes,html,name,**kargs)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py",line 1021,in _html_search_regex
    res = self._search_regex(pattern,string,default,fatal,flags,group)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py",line 1012,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 us
ing 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 it
s complete output.

有什么办法可以解决我的问题吗?

解决方法

似乎 youtube-dl 不是 Instagram 的推荐选择。用户在这里分享: https://www.reddit.com/r/commandline/comments/dh00hf/is_there_a_youtubedl_equivalent_for_instagram/ https://www.reddit.com/r/DataHoarder/comments/73tvru/what_are_the_youtubedls_of_other_things_articles/

正如您已经测试过的,youtube-dl 非常棒,确实是一个非常方便的工具。