Skip to content

Commit f0195fa

Browse files
authored
Update douyin.py
Update douyin.py
1 parent 2e6dbd6 commit f0195fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

douyin/douyin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import requests, json, re, os, sys, random
44
from ipaddress import ip_address
55
from subprocess import Popen, PIPE
6+
import urllib
67

78
class DouYin(object):
89
def __init__(self, width = 500, height = 300):
@@ -54,6 +55,8 @@ def get_video_urls(self, user_id):
5455
share_user = requests.get(share_user_url, headers=self.headers)
5556
_dytk_re = re.compile(r"dytk: '(.+)'")
5657
dytk = _dytk_re.search(share_user.text).group(1)
58+
print('JS签名下载中')
59+
urllib.request.urlretrieve('https://github.com/Jack-Cherish/python-spider/blob/master/douyin/fuck-byted-acrawler.js', 'fuck-byted-acrawler.js')
5760
try:
5861
process = Popen(['node', 'fuck-byted-acrawler.js', str(uid)], stdout=PIPE, stderr=PIPE)
5962
except (OSError, IOError) as err:

0 commit comments

Comments
 (0)