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

Video and Frames Download #6

Closed
vinid opened this issue Jul 9, 2023 · 2 comments
Closed

Video and Frames Download #6

vinid opened this issue Jul 9, 2023 · 2 comments

Comments

@vinid
Copy link

vinid commented Jul 9, 2023

Hi again :)

do you have any code you can share for downloading the videos?

Thank you so much! I appreciate your help on this!

@wisdomikezogwo
Copy link
Owner

It's no problem, however, I'm not sure I can share that.

I could, however, refer you to the same package we used in downloading videos called yt_dlp: https://github.com/yt-dlp/yt-dlp

I hope this is helpful, a possible config for low resolution or high resolution video download can be like this:

def get_ydl_opts(video_dir, archive=False, info=True, subtitle=True, low_res=False):
    if not low_res:
        return {
            'ignoreerrors': True,
            'format': "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b",
            "outtmpl": f'{video_dir}/%(channel)s/%(id)s___%(title)s.%(ext)s',
            "writesubtitles": subtitle,
            "writeautomaticsub": subtitle,
            "subtitlesformat": 'srt',
            "writedescription": info,
            "writeinfojson": info,
            "getcomments": info,
            "writeannotations": info,
            "overwrites": False,
            "download_archive": f'{video_dir}/archive.txt' if archive else None,
            "restrictfilenames": True,
        }
    else:
        return {
            'ignoreerrors': True,
            'format': "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b",
            'format_sort': ["+res:320"],
            "outtmpl": f'{video_dir}/%(channel)s/%(id)s___%(title)s.%(ext)s',
            "writesubtitles": subtitle,
            "writeautomaticsub": subtitle,
            "subtitlesformat": 'srt',
            "writedescription": info,
            "writeinfojson": info,
            "getcomments": info,
            "writeannotations": info,
            "overwrites": False,
            "download_archive": f'{video_dir}/archive.txt' if archive else None,
            "restrictfilenames": True,
        }
        ```

@wisdomikezogwo
Copy link
Owner

Again, let me know if you have any issues reconstructing Quilt!

@vinid vinid closed this as completed Jul 13, 2023
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