File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
2020-03-27-found/2022-03-14-douyin Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ import requests as req
2+ import json
3+
4+
5+ def get_douyin_video (content ):
6+ api = 'https://api.qingdou.vip/miniApp/watermark/index'
7+ params = {
8+ 'val' : content ,
9+ '_platform' : 'miniapp' ,
10+ 'token' : '更改为自己的 token'
11+ }
12+ data = req .post (api , headers = None , data = params , verify = False ).text
13+ data = json .loads (data )
14+ return data ['result' ]['url' ]
15+
16+
17+ url = get_douyin_video ('抖音口令' )
18+ print (url )
Original file line number Diff line number Diff line change 1+ # coding:utf-8
2+
3+ import sys
4+ import requests
5+
6+
7+ def response (flow ):
8+ url = flow .request .url
9+ content_type = flow .response .headers .get ('Content-Type' , default = None )
10+ print (content_type )
11+ if "finder.video.qq.com" in url :
12+ content_type = flow .response .headers .get ('Content-Type' , default = None )
13+ if content_type is not None and content_type == 'video/mp4' :
14+ print (url )
15+ file_name = './urls.txt'
16+ with open (file_name , mode = 'a' , encoding = 'utf-8' ) as f :
17+ f .write (url )
18+ f .write ('\n ' )
19+ f .close ()
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Python技术 公众号文章代码库
88
99## 实例代码
1010
11+ [ 视频号视频下载] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2022-03-23-channel )
12+
1113[ 用 Python 在 Excel 中画画] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2021-12-31-img-excel )
1214
1315[ 一行代码搞定的事还用个锤子的 PS 啊] ( https://github.com/JustDoPython/python-examples/tree/master/doudou/2021-10-28-pillow )
You can’t perform that action at this time.
0 commit comments