{"action":"created","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/12121","repository_url":"https://api.github.com/repos/rg3/youtube-dl","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/12121/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/12121/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/12121/events","html_url":"https://github.com/rg3/youtube-dl/pull/12121","id":207318503,"number":12121,"title":"[adultswim] Fix extractor and add fields","user":{"login":"julianrichen","id":58045,"avatar_url":"https://avatars1.githubusercontent.com/u/58045?v=3","gravatar_id":"","url":"https://api.github.com/users/julianrichen","html_url":"https://github.com/julianrichen","followers_url":"https://api.github.com/users/julianrichen/followers","following_url":"https://api.github.com/users/julianrichen/following{/other_user}","gists_url":"https://api.github.com/users/julianrichen/gists{/gist_id}","starred_url":"https://api.github.com/users/julianrichen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianrichen/subscriptions","organizations_url":"https://api.github.com/users/julianrichen/orgs","repos_url":"https://api.github.com/users/julianrichen/repos","events_url":"https://api.github.com/users/julianrichen/events{/privacy}","received_events_url":"https://api.github.com/users/julianrichen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-02-13T19:41:13Z","updated_at":"2017-04-24T16:31:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rg3/youtube-dl/pulls/12121","html_url":"https://github.com/rg3/youtube-dl/pull/12121","diff_url":"https://github.com/rg3/youtube-dl/pull/12121.diff","patch_url":"https://github.com/rg3/youtube-dl/pull/12121.patch"},"body":"### Before submitting a *pull request* make sure you have:\r\n- [x] At least skimmed through [adding new extractor tutorial](https://github.com/rg3/youtube-dl#adding-support-for-a-new-site) and [youtube-dl coding conventions](https://github.com/rg3/youtube-dl#youtube-dl-coding-conventions) sections\r\n- [x] [Searched](https://github.com/rg3/youtube-dl/search?q=is%3Apr&type=Issues) the bugtracker for similar pull requests\r\n\r\n### In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under [Unlicense](http://unlicense.org/). Check one of the following options:\r\n- [x] I am the original author of this code and I am willing to release it under [Unlicense](http://unlicense.org/)\r\n- [ ] I am not the original author of this code but it is in public domain or released under [Unlicense](http://unlicense.org/) (provide reliable evidence)\r\n\r\n### What is the purpose of your *pull request*?\r\n- [x] Bug fix\r\n- [x] Improvement\r\n- [ ] New extractor\r\n- [ ] New feature\r\n\r\n---\r\n\r\n### Description of your *pull request* and other information\r\n\r\nThis pull request fixes the Adult Swim extractor, This PR should close #11042, #10948 & #8149.\r\n\r\nAdult Swim changed the way some of code was included into the page. Before they used the variable `bootstrappedData` which contained the json for the video on the page. Now they use `__AS_INITIAL_DATA__` as the variable name, but not on all pages. Simple `/videos/[slug]` pages use `__AS_INITIAL_DATA__`, where `/videos/playlist/[slug]` use `bootstrappedData`\r\n\r\nInstead of extracting all the video metadata from that json string only the video id is extracted now. This is because I did some digging and found they use/have a newer api, which seems to be more reliable then regex-ing the page and returns more infromation. It also conveniently returns 401 if the page is now behind a cable subscription login. The api in question is:\r\n\r\n```\r\nhttp://www.adultswim.com/videos/api/v2/videos/[video_id]\r\nhttp://www.adultswim.com/videos/api/v2/videos/[video_id]?fields=[field 1],[field 2]\r\n```\r\n\r\nSo for example:\r\n```\r\nhttp://www.adultswim.com/videos/api/v2/videos/RWFLm_htTKOW-7ZuCfzluQ?fields=id,auth,stream,segments,title,collection_title,season_number,episode_number,description,duration,views,published,images\r\n```\r\n\r\nI found the keys via:\r\n```\r\nhttp://www.adultswim.com/videos/app/show/[show_id]\r\nhttp://www.adultswim.com/videos/app/video/[video_id]\r\n```\r\n\r\nBecause of this new api I was able to added the `series`, `season_number`, `episode_number`, `episode`, `timestamp`, `upload_date`, `views`, `subtitles` (format: vtt, ttml, scc), & `thumbnails` fields to the extractor.\r\n\r\nBecause most of the test cases were no longer available I updated those as well.\r\n\r\nConcerns (?)\r\n- I was unable to test with a cable login, I don't have (free videos where tested)\r\n- The area that could use improvement is when the user inputs a playlist url. At the moment it only downloads the video which is included in the playlist url. This is the same behaviour of the old extractor before it stopped working a few months back, but I assume supporting the download of all videos in the playlist would be better. Not really sure how to do this. Maybe at a later time."},"comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments/296731569","html_url":"https://github.com/rg3/youtube-dl/pull/12121#issuecomment-296731569","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/12121","id":296731569,"user":{"login":"keybounce","id":1859143,"avatar_url":"https://avatars2.githubusercontent.com/u/1859143?v=3","gravatar_id":"","url":"https://api.github.com/users/keybounce","html_url":"https://github.com/keybounce","followers_url":"https://api.github.com/users/keybounce/followers","following_url":"https://api.github.com/users/keybounce/following{/other_user}","gists_url":"https://api.github.com/users/keybounce/gists{/gist_id}","starred_url":"https://api.github.com/users/keybounce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybounce/subscriptions","organizations_url":"https://api.github.com/users/keybounce/orgs","repos_url":"https://api.github.com/users/keybounce/repos","events_url":"https://api.github.com/users/keybounce/events{/privacy}","received_events_url":"https://api.github.com/users/keybounce/received_events","type":"User","site_admin":false},"created_at":"2017-04-24T16:31:53Z","updated_at":"2017-04-24T16:31:53Z","body":"Right now I'll be happy with downloading the videos. Currently Cartoon Network  / Adult Swim is the only channel I watch that I still need a DVR for. (And not only do these companies charge a fee for you to use your right of Time Shifting, but as soon as you stop paying that fee you lose access to your history of shows ... Gotta be a class action suit in there somewhere.) \r\n\r\nGetting meta-data info would be a nice touch, but \"episode title\" would be 100% sufficient for a while.\r\n\r\nNB: This must be a solvable problem. If an untrusted browser can decode and play it, then it must be possible for an untrusted downloader to decode and store it. If worst comes to worst, I could figure out how to get VLC or OBS to record a playback from the browser.\r\n\r\n"}}
{"actor":{"display_login":"keybounce"}}