【问题标题】:Python pytube Playlist is null when the youtube playlist has a chinese name当youtube播放列表有中文名称时,python pytube播放列表为空
【发布时间】:2020-06-15 14:40:58
【问题描述】:

当使用 pl = Playlist(link)

中文名字的播放列表:Not OK - pl 为空 https://www.youtube.com/watch?v=HSUaNt76UAM&list=RDHSUaNt76UAM

播放列表的工作原理: https://www.youtube.com/watch?v=58PpYacL-VQ&list=UUd6MoB9NC6uYN2grvUNT-Zg

是因为编码问题吗?但是pytube在下载中文名字的视频时效果很好。

【问题讨论】:

  • 如果您认为他们的软件包有问题,向 pytube 开发人员(例如,在 github 上)提交错误请求会更合适。

标签: python youtube pytube


【解决方案1】:

这是库的问题,但现在有 a fix 但尚未合并...

这是修复它的临时解决方法:

  • 用 pip 删除了旧版本的库:
pip uninstall pytube3

然后从 fork 安装它:

 pip install git+https://github.com/Maelstrom6/pytube3.git 

希望这会有所帮助.....

【讨论】:

    【解决方案2】:

    试试这个,

    from pytube import Playlist
    playlist = Playlist(youtube video link)
    print('Number of videos in playlist: %s' % len(playlist.video_urls))
    for video_url in playlist.video_urls:
        print(video_url)
    

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-12
      • 2012-10-12
      • 2012-01-19
      • 1970-01-01
      • 2021-12-21
      • 2013-02-16
      相关资源
      最近更新 更多