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

Adding random filenames #2

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

alexloney
Copy link
Contributor

I had the same issue as the user in #1 where the URL I was trying to download from was too large, causing the automatically generated path for the temporary filenames to be too long and resulting in the error message:

OSError: [Errno 36] File name too long

To resolve this, I've added a CLI option of --randomfilenames which will cause all temporary filenames to be converted into UUIDs instead of their full names, thus all filenames will be shortened to an appropriately small length. Because of the way the m3u8 file was used with ffmpeg, the filenames need to be preserved and inserted into the updated m3u8 file, so this is achieved by creating a lookup table in the M3u8Downloader class for the filenames that maps the original full filename to the shortened UUID name, this way the m3u8 file may be reconstructed with a consistent random filename for the final combination of fragments into the full file.

@josephcappadona
Copy link
Owner

Looks good -- thanks for submitting the PR! :)

@josephcappadona josephcappadona merged commit 6dd13e3 into josephcappadona:master Jan 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants