Skip to content

feature request: add handling of account banned by Instagram #39

@yurnov

Description

@yurnov

Current behavior:

The bot supports authentication into Instagram with cookies. However, it's against Instagram TOS and the service may ban users.

Using a banned account leads to the inability to get even content that is available without authorization.

telegram-video-bot  | ERROR: [instagram:story] 3557776196080950804: You need to log in to access this content. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (instagram) to provide account credentials. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies
telegram-video-bot  | 2025-02-01 21:27:34,747 - logger - ERROR - Error downloading video: Command '['yt-dlp', '-S', 'vcodec:h264,fps,res,acodec:m4a', 'https://www.instagram.com/stories/ye/3557776196080950804/', '-o', '/tmp/tmptbspmza9/%(id)s.%(ext)s']' returned non-zero exit status 1.

I propose to add fall back for this case and use non-authorized request when bot is banned. To do so, add some error handling, i.e. when INSTAGRAM_COOKIES=True and we get error with You need to log in to access this content the value INSTAGRAM_COOKIES should be changed to False in runtime.

Originally posted by @ovchynnikov in #30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions