Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - Download 403 Forbidden #1

Closed
BlackSkill88 opened this issue Sep 24, 2020 · 2 comments
Closed

BUG - Download 403 Forbidden #1

BlackSkill88 opened this issue Sep 24, 2020 · 2 comments

Comments

@BlackSkill88
Copy link

Fix:
tiktok.py
add before line 216
this

opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'okhttp'),('referer','https://www.tiktok.com/')]
urllib.request.install_opener(opener)

so the result is:

        try:
            opener = urllib.request.build_opener()
            opener.addheaders = [('User-agent', 'okhttp'),('referer','https://www.tiktok.com/')]
            urllib.request.install_opener(opener)
            urllib.request.urlretrieve(clip.url, f"{settings.vid_filepath}/{clip.author_name}-{clip.id}.mp4")

            clip.mp4 = f"{clip.author_name}-{clip.id}"
            media_info = MediaInfo.parse(f"{settings.vid_filepath}/{clip.author_name}-{clip.id}.mp4")
            duration = media_info.tracks[0].duration
            clip.vid_duration = float(duration) / 1000
            database.updateStatusWithClip(clip.id, "DOWNLOADED", clip)
@HA6Bots
Copy link
Owner

HA6Bots commented Sep 26, 2020

Thank you! I'll commit this ASAP.

@HA6Bots HA6Bots pinned this issue Sep 27, 2020
@HA6Bots
Copy link
Owner

HA6Bots commented Sep 28, 2020

Fixed now. Many thanks.

@HA6Bots HA6Bots closed this as completed Sep 28, 2020
@HA6Bots HA6Bots unpinned this issue Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants