
我無法使用 下載 Facebook 影片youtube-dl
。下載過程中出現以下錯誤:
$ youtube-dl https://www.facebook.com/video.php?v=10152588878600983&set=vb.107925785982&type=2&theater
[1] 5101
[2] 5102
[3] 5103
theater: command not found
[2]- Done set=vb.107925785982
[3]+ Done type=2
[2]- Done set=vb.107925785982
[3]+ Done type=2
$ [generic] video: Requesting header
$ WARNING: Falling back on generic information extractor.
[generic] video: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [Errno 8] _ssl.c:510: EOF occurred in violation of protocol>
[1]+ Exit 1 youtube-dl
https://www.facebook.com/video.php?v=10152588878600983
答案1
使用時youtube-dl
嘗試清理您使用的 URL。例如,以下網址將要工作。謝謝你的影片^_~。
你是怎麼安裝的youtube-dl
?如果您透過安裝它apt
,我會推薦以下內容:
sudo apt-get remove youtube-dl
sudo apt-get install $(apt-cache depends youtube-dl | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ')
sudo pip install youtube-dl
pip
似乎有更新的版本。
需要對某些字元進行轉義以防止出現問題。您可以用單引號引用您的 URL 以幫助防止這些問題:
youtube-dl 'https://domain.tld/path/file.ext'
答案2
您必須轉義 & 符號 ( &
) 或將整個 URL 放在引號中因為 & 符號是 shell 解釋的特殊字元之一,它會阻止您將整個 URL 傳遞給 youtube-dl。更多關於此。因此,只需將其放在單引號中就足夠了:
youtube-dl 'https://www.facebook.com/video.php?v=10152588878600983&set=vb.107925785982&type=2&theater'
答案3
右鍵點選影片 > 點選「顯示影片 URL」> 複製其中的 URL(不是 Facebook 頁面的 URL)。
然後,將終端機上複製的 URL 貼到「youtube-dl」旁邊
例如:youtube-dlhttps://www.facebook.com/Amhara-Mass-Media-Agency-118697174971952/
答案4
youtube-dl --username xxxxx --password xxxxx -t -f mp4 'https://www.facebook.com/xxxxx/videos/123456789'