Closed l91liliang closed 1 year ago
目前bv视频需要带cookie才行 #62
目前bv视频需要带cookie才行 #62
添加了cookie后,使用macOS 的VScode运行会报错,相关说明可见附加md文件。恳请帮忙解决,多谢🙏 报错代码及信息.md
如果你使用python中的模版字符串""" """
来包含cookie,那你要确保其中没有加入额外的回车,因为模版字符串会包含其中的所有字符
cookie = """
xxxxxxxxxxxxxxxxxxxxxxxx
"""
是一种错误的写法,因为开头和结尾均包含了额外的回车,所以发生了错误。如果你一定要使用模版字符串,正确的写法应该是
cookie = """xxxxxxxxxxxxxxxxxxxxxxxx"""
不过,还是使用""
吧,这个属于python基础语法的问题了
订正一下,好像三引号不叫模版字符串,懂意思就行
完美解决,膜拜大佬。
初步判断是因为未登录用户在b站只能看480P视频的缘故。