为账号系统设计,youtube-dl有支持cookie的接口,其cooke格式为Mozilla/Netscape格式,文件开始须有

# HTTP Cookie File

# Netscape HTTP Cookie File

标记。
此类cookie,可用浏览器插件cookie.txt导出:
cookie_get.png

参考其说明:How do I pass cookies to youtube-dl?

**How do I pass cookies to youtube-dl?**

Use the --cookies option, for example --cookies /path/to/cookies/file.txt.

In order to extract cookies from browser use any conforming browser extension for exporting cookies. For example, cookies.txt (for Chrome) or cookies.txt (for Firefox).

Note that the cookies file must be in Mozilla/Netscape format and the first line of the cookies file must be either # HTTP Cookie File or # Netscape HTTP Cookie File. Make sure you have correct newline format in the cookies file and convert newlines if necessary to correspond with your OS, namely CRLF (\r\n) for Windows and LF (\n) for Unix and Unix-like systems (Linux, macOS, etc.). HTTP Error 400: Bad Request when using --cookies is a good sign of invalid newline format.

Passing cookies to youtube-dl is a good way to workaround login when a particular extractor does not implement it explicitly. Another use case is working around CAPTCHA some websites require you to solve in particular cases in order to get access (e.g. YouTube, CloudFlare).



另一类cookie类型,为Annie所支持,在使用Annie情况下,可加载其站点cookie。
Annie同样也支持Mozilla/Netscape格式cookie。

这类cookie,在浏览器调试模式下,从其网址headers中取。以chrome浏览器为例,如图:
cookies.png
在这里,找到域名为所需要网站的URL链接,取它的cookie。
如此,可取出此网站的cookie。另存为txt文件,如baidu.txt。



那么,在CR TubeGet之[参数设置]中,可指定cookie文件所在位置:
cookie_set.png
当下载此站点视频时,CR TubeGet可根据视频URL域名,在其位置找对应站点的cookie。



若在IE浏览器中登录账号,那么CR自动获取cookie,对有些站点就有了可能。
这样,下载网站vip视频成为可能。对,就是这么简单!

標籤:none

添加新評論