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

Also add "file size" in -j option #1926

Closed
xubuntu4iran opened this issue Dec 9, 2013 · 2 comments
Closed

Also add "file size" in -j option #1926

xubuntu4iran opened this issue Dec 9, 2013 · 2 comments

Comments

@xubuntu4iran
Copy link

@xubuntu4iran xubuntu4iran commented Dec 9, 2013

youtube-dl --proxy "" -j http://www.aparat.com/v/teYF2
WARNING: Falling back on generic information extractor.
{"extractor": "generic", "format": "0 - unknown", "uploader": "www.aparat.com", "format_id": "0", "id": "cc8ea41f89ccbcdcec29ead4965101d6859928", "stitle": "\u062d\u0644\u0642\u0647 \u0647\u0648\u0634\u0645\u0646\u062f \u0628\u0631\u0627\u06cc \u06a9\u0646\u062a\u0631\u0644 \u062a\u0644\u0641\u0646", "playlist": null, "title": "\u062d\u0644\u0642\u0647 \u0647\u0648\u0634\u0645\u0646\u062f \u0628\u0631\u0627\u06cc \u06a9\u0646\u062a\u0631\u0644 \u062a\u0644\u0641\u0646", "url": "http://host11.aparat.com//public/user_data/flv_video_new/287/cc8ea41f89ccbcdcec29ead4965101d6859928.apt", "extractor_key": "Generic", "playlist_index": null, "ext": "apt", "webpage_url": "http://www.aparat.com/v/teYF2", "fulltitle": "\u062d\u0644\u0642\u0647 \u0647\u0648\u0634\u0645\u0646\u062f \u0628\u0631\u0627\u06cc \u06a9\u0646\u062a\u0631\u0644 \u062a\u0644\u0641\u0646"}
@phihag
Copy link
Contributor

@phihag phihag commented Dec 9, 2013

filesize will be present in the output when provided by the extractor:

$ youtube-dl http://fast.wistia.net/embed/iframe/sh7fpupwlt -j | jq .formats[].filesize
11981466
12255921
19524818
19565116
38287449
38391271
432792422

However, as detailed in #190 and probably a dozen other issues, it is not possible to always determine the filesize in advance, and complicated and slow (we have to send an extra request) to to determine it even if the download is via HTTP, and the server supports HEAD requests, and it sends a Content-Length header.

Since I don't need to determine file sizes in advance and it's more a ballpark figure anyways (For example, YouTube is always switching around files, so when we actually go download the file, it size may have changed already), I'm not interested in developing this option myself. Feel free to pose a pull request that offers that though (just make sure to test it at least that it doesn't mess with - at least - RTMP, HTTPS, broken HTTP servers that invalidate content after the first request, HTTP servers that don't support HEAD as per spec (i.e. return 501 or 415), HTTP servers that return HEAD requests without Content-Type, or with an incorrect one.

@phihag phihag closed this Dec 9, 2013
@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 9, 2013

I'm sorry for repeating issue, thank you for description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.