A few lines of code python crawling Tencent and iQIYI VIP movie (use full-out analytic)

The paper is more suitable for fast speed reader, after all, is surf the internet.

          ...... Tencent video, iQIYI and so many movies are required to recharge VIP to see, good-looking movie only let you Look for 5 minutes, it was uncomfortable, it is the charge of money or charge money.

       Now ye who can say NO, and teach you to use a few simple lines of code will be able to watch free movies, ado, see below.

       First things have to use: Pycharm (. Python3 *, requests module installed), Chrome, national resolve (Artifact)

First, the browser search national resolve, right-click to open click on "check" (or press F12)

Second, the URL will want to see VIP movie copy down, paste it into the address parsing of all the people playing, press F5 to refresh. You can see a lot of * .ts files, these are fragments of the film, we have to climb is that these files.

Third, the video progress bar is pulled directly tail, and finally we found a fragment is 18771789.ts, there User-Agent (which we used to disguise the browser, or some reptiles are not allowed).

Fourth, the following code:

import requests

# Disguise the browser's head

headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36"}

for i in range(1789):

    url="http://acfun.iqiyi-kuyun.com/20190207/ExaAuF8X/1000kb/hls/bUPgq1877%03d.ts"%i  #Request Url

 

    print(url)

    r=requests.get(url,headers=headers)

# Open a file to store movies

    f=open('D:\DATA\movies/{}'.format(url[-10:]),"ab")

    f.write(r.content)#写入文件

f.close()

我们要注意URL的后面是有规律的,后面都是bUPgq18877xxx.ts,那么我们把后面换成“%3d”

,如此循环下去就是所有电影片段的URL了。

五、下面就等着下载就好了。这下载的电影没有头广告哦。但是还没有完哦。

六、最后一步,在下好了的文件夹里拼接这些电影。

        ⑴新建文本文件,输入cmd,保存重命名为run.bat;或者进入cmd然后cd保存电影的目录下。

        ⑵运行run.bat,接下来输入拼接命令(copy /b *.ts 电影名.mp4),完成拼接。

       ⑶最后当然就是观看啦,画质还是很不错的,起码比枪版好上好多。

最后这个效果还行吧,上面我只下载了7分48秒,给看看效果,还是很满意哒。

有想看的电影,有要你开会员的,不妨试试!

Guess you like

Origin blog.csdn.net/weixin_41447267/article/details/93774460