Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Download only 1mb of file and use title in filename #11609
Comments
|
|
|
In youtube_dl/downloader/common.py, change this line:
To:
And then download with:
But what's your purpose? |
|
I have to download of lot of videos to see their content. I want to limit the download to 1mb even if the size is big. Because i just want to have a glimpse. It didnt solve the problem. if the mp4 is in fragments. then --test will check with respect to the size of the fragment rather than the total file size. |
|
OK I got it.
Sounds like a bug. Could you share the URL of such a video? |
|
youtube-dl --test --restrict-filenames --no-part -f '[width<=500][ext=flv]' -o "%(title)s_f%(format_id)s.%(ext)s" "https://www.bloomberg.com/news/videos/2017-02-14/is-the-banking-environment-getting-better" i have _TEST_FILE_SIZE = 4048576 Goal to achive: i dont want to download more than 4mb of file size. |
|
Bloomberg is a special case - if you cut the video randomly, it's likely you'll get a broken file. Try to set _TEST_FILE_SIZE to a smaller size. |
|
Hi, |
I am using the below to download only 1 mb of the file.
youtube-dl -v URL -o - | head -c 1000000 > output.mp4can i use %(title)s.%(ext)s instead of output.mp4