Skip to content

Commit

Permalink
share_desc change and replace invalid characters
Browse files Browse the repository at this point in the history
  • Loading branch information
steven7851 authored May 28, 2018
1 parent d76f9b7 commit 2053929
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion douyin_pro_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ def get_video_urls(self, user_id):
html = json.loads(req.text)
for each in html['aweme_list']:
share_desc = each['share_info']['share_desc']
for c in r'\/:*?"<>|':
share_desc = share_desc.replace(c, '')
unix_timestamp = each['create_time']
utc_time = datetime.fromtimestamp(unix_timestamp, timezone.utc)
local_time = utc_time.astimezone()
tc = local_time.strftime('%Y-%m-%d-%H-%M-%S')
if '抖音-原创音乐短视频社区' == share_desc:
if share_desc in ['抖音-原创音乐短视频社区', 'TikTok']:
video_names.append(tc + '.mp4')
else:
video_names.append(tc + '-' + share_desc + '.mp4')
Expand Down

0 comments on commit 2053929

Please sign in to comment.