Git Product home page Git Product logo

pornhub-downloader's Introduction

PornHub-Downloader

目前 main 分支下的代码使用 Asyncio + Aiohttp + Pyppeteer,原先的旧代码保留在其他分支中。

为什么需要异步下载

如果下载电影时网速能够拉满的话,一个一个下和一个下完再下另一个并没有什么区别,但是很多时候因为资源服务器设在境外,下载的网速是受到很大限制的。比如你的最大下载速度是 10M/s,但是下载单个资源的最大速度是 1M/s,这样的情况下,同时下载 10 个电影能够最大效率利用你的带宽。

Asyncio 最操蛋的地方是他的 API 在每一个 Python 版本(3.4/3.5/3.7/3.10)中都有不小的变化,这就导致在各种博客、教程里你能看到各种各样的 asyncio 代码。

Pyppeteer 最操蛋的地方是他是 Puppeteer 的 Python 版本,他的选择器极其难用,不过也可能是我太笨了。所以在解析这部分我是用同步的方法去做的,这必然对整个程序的速度有些影响,但是也不大,毕竟大部分时间我们都在发请求,然后把响应写入硬盘。

image-20211226173811160

pornhub-downloader's People

Contributors

frazierlei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pornhub-downloader's Issues

请问作者还会再更新吗?

从上次提问已经过去好几年了,不过作者的代码我一直都在有学习,从近几年来我修改了一下作者关于下载model全部视频的代码(主要是爬取两页及两页以上的所有视频链接),但是最近爬的时候特别是多线程获取了flashvar变量里面的视频地址访问之后发现根本不是原视频地址。不知道老哥有没有更新代码,以及老哥有没有些爬这个的新思路。

关于下载m3u8文件提示错误代码470的问题

我学习了一段时间python之后自己也动手写了一些代码来爬p站视频,但是到p站视频的m3u8文件有嵌套,最终我找到了整个视频的m3u8文件,并且进行aiohttp和aiofiles进行异步连接下载。但是连接一直提示470,并且告诉我说这个request user unauthorized我用老哥你的py程序跑起来 ffmpeg也一直提示470.想问下老哥这种情况有遇到过吗

I got RuntimeWarning when running main function

python pornhub_downloader.py https://cn.pornhub.com/view_video.php\?viewkey\=ph********39

Following is the error information. How do I fix it?

sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.