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

IndexError: list index out of range #15

Open
xxkillaxx opened this issue Mar 18, 2022 · 4 comments
Open

IndexError: list index out of range #15

xxkillaxx opened this issue Mar 18, 2022 · 4 comments

Comments

@xxkillaxx
Copy link

Video loading does not work. I get an error:
tiktok_downloader.snaptik(url).get_media()[0].download()

Traceback (most recent call last):
File "C:\Users\Николай\Desktop\BOT_tg\test.py", line 17, in
tiktok_downloader.snaptik(url).get_media()[0]
IndexError: list index out of range

HELP!!!

@gcipherd
Copy link

Video loading does not work. I get an error: tiktok_downloader.snaptik(url).get_media()[0].download()

Traceback (most recent call last): File "C:\Users\Николай\Desktop\BOT_tg\test.py", line 17, in tiktok_downloader.snaptik(url).get_media()[0] IndexError: list index out of range

HELP!!!

I don't know if you solved this yet, but you can use Tikmate instead; it works for me.

tiktok_downloader.tikmate().get_media(url)[0]

notice the url now it's a parameter of get_media.

@xxkillaxx
Copy link
Author

Video loading does not work. I get an error: tiktok_downloader.snaptik(url).get_media()[0].download()
Traceback (most recent call last): File "C:\Users\Николай\Desktop\BOT_tg\test.py", line 17, in tiktok_downloader.snaptik(url).get_media()[0] IndexError: list index out of range
HELP!!!

I don't know if you solved this yet, but you can use Tikmate instead; it works for me.

tiktok_downloader.tikmate().get_media(url)[0]

notice the url now it's a parameter of get_media.

Thanks for the help.

@3dian
Copy link

3dian commented Mar 27, 2022

same to me
seems there is something wrong with snaptik API

@Rizvanov-Rinat
Copy link
Contributor

Rizvanov-Rinat commented Apr 17, 2022

As practice shows, some services stop working from time to time. And this library provides a convenient enumeration of all services. You can use it something like this:

from tiktok_downloader import services, InvalidUrl

def downloader(url):
    name = 'Video_name.mp4'
    for service in services.values():
        try:
            media = service(url)
        except InvalidUrl as e: # InvaldUrl exception sometimes occurs even with correct URLs.
            print(e)
        if media:
            media[0].download(name)
            break
    else:
        print(f'InvalidUrl: {url}')

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

4 participants