推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Zhepro
V2EX  ›  Python

Python 怎么把 html 文件里的 mp4 视频提取出来?

  •  
  •   Zhepro · Jun 19, 2020 · 4085 views
    This topic created in 2293 days ago, the information mentioned may be changed or developed.
    用 code 打开是这样的:
    <video width="950" height="950" controls autoplay loop>
    <source type="video/mp4" src="data:video/mp4;base64,---一堆字母--->
    Your browser does not support the video tag.
    </video>
    用 chrome 倒是可以手动下载,但是想批量提取,怎么弄呢
    5 replies  •  2020-06-20 08:15:11 +08:00
    crab
        1
    crab  
       Jun 19, 2020
    b64decode
    imkuang
        2
    imkuang  
       Jun 19, 2020
    把 base64 后面那一堆字符拿出来,然后用 base64 解码
    lqzhgood
        3
    lqzhgood  
       Jun 19, 2020
    视频也压 base64~~ 是个狠人呀
    iConnect
        4
    iConnect  
       Jun 19, 2020 via Android
    应该是找 .ts 文件地址,下载拼接起来
    kof21411
        5
    kof21411  
       Jun 20, 2020
    lists = etree.HTML(html)
    infos = lists.xpath("//video/source/@src")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2605 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 15:27 · PVG 23:27 · LAX 08:27 · JFK 11:27
    ♥ Do have faith in what you're doing.