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

No downloadable video via "--prefer cdn" option #341

Closed
rafaelmendy opened this issue Mar 13, 2016 · 3 comments
Closed

No downloadable video via "--prefer cdn" option #341

rafaelmendy opened this issue Mar 13, 2016 · 3 comments

Comments

@rafaelmendy
Copy link

Hi
It seems that, downloading from courses with new layouts is possible with youtube-dl. but "prefer cdn" option doesn't work in these courses. and i face "No downloadable video" comment. for example https://courses.edx.org/courses/BerkeleyX/Stat_2.3x/2T2014/info

@iemejia
Copy link
Member

iemejia commented Apr 17, 2016

Actually it is not a question of the new layout. The current edx extractor looks for the direct video URLs in the in the metadata, and for this given course the metadata info is not there. 'sources": []'.
What you can do is to change the formats that are extracted in the resources section to download it, e.g. add the .mp4 to this section in parsing.py.

DEFAULT_FILE_FORMATS = ['e?ps', 'pdf', 'txt', 'doc', 'xls', 'ppt',
'docx', 'xlsx', 'pptx', 'odt', 'ods', 'odp', 'odg',
'zip', 'rar', 'gz', 'mp3', 'mp4']

I am sorry if this is not the ideal solution, but I have been thinking about adding an option to overwrite file formats for cases like this one, and the code has everything to support it, I hope me or somebody else can implement this in the future.

@iemejia
Copy link
Member

iemejia commented Apr 17, 2016

Actually I felt motivated and implemented it as a new set of options in PR_#352. Once this is merged I will close this issue.

rbrito added a commit that referenced this issue Apr 19, 2016
Add new options to support arbitrary file format extraction.

From the pull request by @iemejia:

----
## Proposed changes

Currently the file formats extracted during parsing are fixed to some common formats. But it is possible that courses would require particular formats (e.g. java, jar, R, py, etc).

I add three new options to allow this:
--list-file-formats   list the default file formats extracted
--file-formats FILE_FORMATS appends file formats to be extracted (comma separated)
--overwrite-file-formats if active overwrites the file formats to be extracted

This can address the case where videos are not in the metadata but in the html e.g. adding the --file-formats=mp4. See Issue #341
----

Thanks @iemejia for the excellent contribution.
@iemejia
Copy link
Member

iemejia commented Apr 20, 2016

I am closing this one since PR #352 is merged and it should address this issue. Please feel free to comment or reopen if you have further issues.

@iemejia iemejia closed this as completed Apr 20, 2016
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