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

Wrong value for the length attribute of the enclosure tag on the rss feeds #774

Open
maru-sama opened this issue Jan 8, 2025 · 3 comments
Assignees
Labels

Comments

@maru-sama
Copy link

Good Morning,

While trying to download a few videos from the latest conference I noticed that the length attribute of the enlosure tag is different from the actual content length of the video itself.
For example:

The first entry in
https://media.ccc.de/c/37c3/podcast/mp4-hq.xml
has a defined length of

<enclosure url="https://cdn.media.ccc.de/congress/2023/h264-hd/37c3-58019-deu-NSU-Watch_Aufklaeren_Einmischen_Der_Jahresrueckblick_2023_hd.mp4" length="562036736" <-- length type="video/mp4"/>

While the correct size according to wget is the following

HTTP request sent, awaiting response... 200 OK Length: 562902679 (537M) [video/mp4] Saving to: ‘37c3-58019-deu-NSU-Watch_Aufklaeren_Einmischen_Der_Jahresrueckblick_2023_hd.mp4’

I am using the length value to check if a file has been fully downloaded or should be fetched again. Since the value is not correct I cannot do that and have to always send a GET request to fetch the Content-Length.

@saerdnaer
Copy link
Member

Meta: Why not send a HEAD request instead a GET request?

Voctoweb currently get's only rounded file sizes in MB, which have to be "unrounded" to Bytes for the rss feeds:

https://github.com/voc/voctopublish/blob/15ad92c7e31e1029d02c06646e3c6f9a56b0b4f9/voctopublish/api_client/voctoweb_client.py#L567

https://github.com/voc/voctopublish/blob/15ad92c7e31e1029d02c06646e3c6f9a56b0b4f9/voctopublish/api_client/voctoweb_client.py#L636-L637

@Kunsi Whats your opinion on changing that to a float value?

@saerdnaer saerdnaer added the api label Jan 10, 2025
@Kunsi
Copy link

Kunsi commented Jan 10, 2025

@saerdnaer +1 for accurate file sizes. If there are no issues on the voctoweb side, we can change that.

@maru-sama
Copy link
Author

I just skimmed over the code, but is there a specific reason why it gets converted from bytes to megabytes in the first place?

@saerdnaer saerdnaer self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants