add some scripts.
This commit is contained in:
@ -1,3 +1,28 @@
|
||||
'''
|
||||
不知道为什么,这样写不起作用。修改了源代码
|
||||
|
||||
# 查看yt_dlp的安装路径
|
||||
python3 -c "import yt_dlp; print(yt_dlp.__file__)"
|
||||
|
||||
进入到 extractor/pornhub.py 文件,找到 _real_extract 函数
|
||||
在return语句之前增加代码:
|
||||
|
||||
|
||||
# 提取收藏次数(favoritesCounter 的内容)
|
||||
favorites_raw = self._search_regex(
|
||||
r'<span class="favoritesCounter">\s*([\dKkMm,. ]+)\s*</span>',
|
||||
webpage, 'favorites count', fatal=False)
|
||||
|
||||
# 如果找到收藏次数,则进行解析和单位转换
|
||||
favorites_count = '0'
|
||||
if favorites_raw:
|
||||
# 清理空格、换行,并解析数字和单位
|
||||
favorites_count = favorites_raw.strip().replace(',', '')
|
||||
|
||||
并在return中增加
|
||||
'favorite_count': favorites_count,
|
||||
'''
|
||||
|
||||
from yt_dlp.extractor.pornhub import PornHubIE
|
||||
import re
|
||||
|
||||
|
||||
Reference in New Issue
Block a user