Skip to content

Commit 40b10ae

Browse files
authored
Update douyin.py
1 parent f295278 commit 40b10ae

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

douyin/douyin.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def get_video_urls(self, user_id, type_flag='f'):
4141
max_cursor = 0
4242
has_more = 1
4343
i = 0
44-
x = 0
45-
share_user_url = 'https://www.amemv.com/share/user/%s' % user_id
44+
share_user_url = 'https://www.douyin.com/share/user/%s' % user_id
4645
share_user = requests.get(share_user_url, headers=self.headers)
4746
while share_user.status_code != 200:
4847
share_user = requests.get(share_user_url, headers=self.headers)
@@ -69,15 +68,10 @@ def get_video_urls(self, user_id, type_flag='f'):
6968
try:
7069
while html['aweme_list'] == []:
7170
i = i + 1
72-
x = x + 1
7371
sys.stdout.write('已重新链接' + str(i) + '次 (若超过100次,请ctrl+c强制停止再重来)' + '\r')
7472
sys.stdout.flush()
7573
process = Popen(['node', 'fuck-byted-acrawler.js', str(user_id)], stdout=PIPE, stderr=PIPE)
7674
_sign = process.communicate()[0].decode().strip('\n').strip('\r')
77-
if x > 2:
78-
x = 0
79-
process = Popen(['node', 'fuck-byted-acrawler.js', str(user_id)], stdout=PIPE, stderr=PIPE)
80-
_sign = process.communicate()[0].decode().strip('\n').strip('\r')
8175
user_url = user_url_prefix + '/?user_id=%s&max_cursor=%s&count=21&aid=1128&_signature=%s&dytk=%s' % (user_id, max_cursor, _sign, dytk)
8276
req = requests.get(user_url, headers=self.headers)
8377
while req.status_code != 200:
@@ -86,7 +80,6 @@ def get_video_urls(self, user_id, type_flag='f'):
8680
except:
8781
pass
8882
i = 0
89-
x = 0
9083
for each in html['aweme_list']:
9184
try:
9285
url = 'https://aweme.snssdk.com/aweme/v1/play/?video_id=%s&line=0&ratio=720p&media_type=4&vr_type=0&test_cdn=None&improve_bitrate=0'

0 commit comments

Comments
 (0)