码迷,mamicode.com
首页 > 编程语言 > 详细

Python 爬虫 Vimeo视频下载链接

时间:2017-08-10 13:18:22      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:nec   stat   reload   import   web   nload   运行   user   下载   

python vimeo_d.py https://vimeo.com/228013581  

在https://vimeo.com/上看到稀罕的视频 按照上面加上视频的观看地址运行即可获得视频下载链接

(为了凑够150字+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++) 

 1 #coding:utf-8
 2 #sample url = ‘https://vimeo.com/228013581‘
 3 
 4 
 5 import requests
 6 import json
 7 import sys
 8 reload(sys)
 9 sys.setdefaultencoding(utf-8)
10 
11 
12 def process(cmd,url):
13     _url = %s?action=load_download_config % url
14 
15     headers ={
16     Accept-Encoding:gzip, deflate, br,
17     Accept-Language:zh-CN,zh;q=0.8,en;q=0.6,
18     Connection:keep-alive,
19     Host:vimeo.com,
20     Referer:%s % url,
21     User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36,
22     X-Requested-With:XMLHttpRequest
23     }
24 
25     r = requests.get(_url,headers=headers)
26     #print r.status_code
27     f = r.json()[files]
28     for i in range(0,len(f)):
29         ml = f[i]
30         print "第%s条Download信息" % (i+1)
31         print 标题: %s % ml[download_name]
32         print 链接: %s % ml[download_url]
33 
34 if __name__ == __main__:
35     import sys
36     process(parse,sys.argv[1])

 

Python 爬虫 Vimeo视频下载链接

标签:nec   stat   reload   import   web   nload   运行   user   下载   

原文地址:http://www.cnblogs.com/cutesnow/p/7338176.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!