Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da3b306

Browse files
add code
1 parent b5f8547 commit da3b306

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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)

‎doudou/2022-03-23-channel/app.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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()

‎doudou/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /