{"action":"created","issue":{"url":"https://api.github.com/repos/shk3/edx-downloader/issues/136","labels_url":"https://api.github.com/repos/shk3/edx-downloader/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/shk3/edx-downloader/issues/136/comments","events_url":"https://api.github.com/repos/shk3/edx-downloader/issues/136/events","html_url":"https://github.com/shk3/edx-downloader/pull/136","id":51420142,"number":136,"title":"cdn video downloads, seperate folder for each week... ","user":{"login":"coiby","id":1511656,"avatar_url":"https://avatars.githubusercontent.com/u/1511656?v=3","gravatar_id":"","url":"https://api.github.com/users/coiby","html_url":"https://github.com/coiby","followers_url":"https://api.github.com/users/coiby/followers","following_url":"https://api.github.com/users/coiby/following{/other_user}","gists_url":"https://api.github.com/users/coiby/gists{/gist_id}","starred_url":"https://api.github.com/users/coiby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coiby/subscriptions","organizations_url":"https://api.github.com/users/coiby/orgs","repos_url":"https://api.github.com/users/coiby/repos","events_url":"https://api.github.com/users/coiby/events{/privacy}","received_events_url":"https://api.github.com/users/coiby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-09T12:10:38Z","updated_at":"2015-05-13T12:40:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shk3/edx-downloader/pulls/136","html_url":"https://github.com/shk3/edx-downloader/pull/136","diff_url":"https://github.com/shk3/edx-downloader/pull/136.diff","patch_url":"https://github.com/shk3/edx-downloader/pull/136.patch"},"body":"1. CDN video downloads\r\n    a. By default, download video from CDN first. If no link found, then use youtube-dl instead. (Youtube is blocked in some countries like China:(, so I make this a first option. And most of courses host videos on CDN.)\r\n    b. Use \"-nc\" or \"--no-cdn\" to disable this option.\r\n   \r\n\r\n2. Create seperate folder for each week\r\n    Many courses have too many videos in a module. It's better not to put all files into one folder. Directory structure(course \"GG101x The Science of Happiness\") now looks like this,\r\n.\r\n├── How to Navigate this Course\r\n│   ├── 01-Intro to edX Video.mp4\r\n│   ├── 01-Intro to edX Video.srt\r\n│   ├── 02-Courseware Video.mp4\r\n│   ├── 02-Courseware Video.srt\r\n│   ├── 03-Navigation.mp4\r\n│   ├── 03-Navigation.srt\r\n│   ├── 04-Discussion.mp4\r\n│   ├── 04-Discussion.srt\r\n│   ├── 05-Summary.mp4\r\n│   └── 05-Summary.srt\r\n├── Week 10 WrapUp\r\n│   └── 01-Video Chat with Emiliana Simon-Thomas and Dacher Keltner.mp4\r\n├── Week 1 Introduction to the Science of Happiness\r\n│   ├── 01-What Makes You Happy.mp4\r\n│   ├── 01-What Makes You Happy.srt\r\n│   ├── 02-Welcome from the Instructors.mp4\r\n│   ├── 02-Welcome from the Instructors.srt\r\n│   ├── 03-Check-Ins Explained.mp4\r\n...\r\n\r\n3. Extracting filenames from ```<div class=\"..xmodule_VideoModule\"> <h2></h2></div>```\r\n    h2 element gives names that make more sense. Vidoes on youtube have names like edX-FA12-cware-4_100(https://courses.edx.org/courses/course-v1:BerkeleyX+GG101x-2+1T2015/courseware/1ff96c6155eb40c39140c656cdc2708b/fe61eec71862458eb2526dbace127fb4/),  RICADBIOT314-V004400_100(https://courses.edx.org/courses/RiceX/AdvBIO.2x/2014T3/courseware/87f77ac155d749bcbb4a41bf1327502e/e56fccd2e69f4d3bb9dd4df929034624/).   \r\n\r\nOther changes:\r\n\r\n4. Catch exception when using youtube-dl\r\n   If youtube-dl isn't installed, pass the exception and continue.\r\n\r\n5.  Extract video section from div(class=xmodule_VideoModule) which make it easier to extract CDN download links."},"comment":{"url":"https://api.github.com/repos/shk3/edx-downloader/issues/comments/101651574","html_url":"https://github.com/shk3/edx-downloader/pull/136#issuecomment-101651574","issue_url":"https://api.github.com/repos/shk3/edx-downloader/issues/136","id":101651574,"user":{"login":"iemejia","id":79476,"avatar_url":"https://avatars.githubusercontent.com/u/79476?v=3","gravatar_id":"","url":"https://api.github.com/users/iemejia","html_url":"https://github.com/iemejia","followers_url":"https://api.github.com/users/iemejia/followers","following_url":"https://api.github.com/users/iemejia/following{/other_user}","gists_url":"https://api.github.com/users/iemejia/gists{/gist_id}","starred_url":"https://api.github.com/users/iemejia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iemejia/subscriptions","organizations_url":"https://api.github.com/users/iemejia/orgs","repos_url":"https://api.github.com/users/iemejia/repos","events_url":"https://api.github.com/users/iemejia/events{/privacy}","received_events_url":"https://api.github.com/users/iemejia/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T12:40:20Z","updated_at":"2015-05-13T12:40:20Z","body":"Cool, can you base your changes in the new structure (refactor) I am trying to use in the parallel pull request I just did (or in the parallel branch of my repo).\r\nThe idea is to add a new key called 'video_url' to the extract_page_resources function, this new dict 'page_resources' will then be returned and used to download all the resources, \r\nIf you have any issue or question don't hesitate to write me."}}