mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	release 2016.02.27
This commit is contained in:
		| @@ -92,7 +92,9 @@ If you want to create a build of youtube-dl yourself, you'll need | |||||||
|  |  | ||||||
| ### Adding support for a new site | ### Adding support for a new site | ||||||
|  |  | ||||||
| If you want to add support for a new site, you can follow this quick list (assuming your service is called `yourextractor`): | If you want to add support for a new site, first of all **make sure** this site is **not dedicated to [copyright infringement](#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. youtube-dl does **not support** such sites thus pull requests adding support for them **will be rejected**. | ||||||
|  |  | ||||||
|  | After you have ensured this site is distributing it's content legally, you can follow this quick list (assuming your service is called `yourextractor`): | ||||||
|  |  | ||||||
| 1. [Fork this repository](https://github.com/rg3/youtube-dl/fork) | 1. [Fork this repository](https://github.com/rg3/youtube-dl/fork) | ||||||
| 2. Check out the source code with `git clone git@github.com:YOUR_GITHUB_USERNAME/youtube-dl.git` | 2. Check out the source code with `git clone git@github.com:YOUR_GITHUB_USERNAME/youtube-dl.git` | ||||||
| @@ -140,16 +142,17 @@ If you want to add support for a new site, you can follow this quick list (assum | |||||||
|     ``` |     ``` | ||||||
| 5. Add an import in [`youtube_dl/extractor/__init__.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py). | 5. Add an import in [`youtube_dl/extractor/__init__.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py). | ||||||
| 6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. | 6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. | ||||||
| 7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200). Add tests and code for as many as you want. | 7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L68-L226). Add tests and code for as many as you want. | ||||||
| 8. If you can, check the code with [flake8](https://pypi.python.org/pypi/flake8). | 8. Keep in mind that the only mandatory fields in info dict for successful extraction process are `id`, `title` and either `url` or `formats`, i.e. these are the critical data the extraction does not make any sense without. This means that [any field](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L138-L226) apart from aforementioned mandatory ones should be treated **as optional** and extraction should be **tolerate** to situations when sources for these fields can potentially be unavailable (even if they always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. For example, if you have some intermediate dict `meta` that is a source of metadata and it has a key `summary` that you want to extract and put into resulting info dict as `description`, you should be ready that this key may be missing from the `meta` dict, i.e. you should extract it as `meta.get('summary')` and not `meta['summary']`. Similarly, you should pass `fatal=False` when extracting data from a webpage with `_search_regex/_html_search_regex`. | ||||||
| 9. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this: | 9. Check the code with [flake8](https://pypi.python.org/pypi/flake8). | ||||||
|  | 10. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this: | ||||||
|  |  | ||||||
|         $ git add youtube_dl/extractor/__init__.py |         $ git add youtube_dl/extractor/__init__.py | ||||||
|         $ git add youtube_dl/extractor/yourextractor.py |         $ git add youtube_dl/extractor/yourextractor.py | ||||||
|         $ git commit -m '[yourextractor] Add new extractor' |         $ git commit -m '[yourextractor] Add new extractor' | ||||||
|         $ git push origin yourextractor |         $ git push origin yourextractor | ||||||
|  |  | ||||||
| 10. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. | 11. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. | ||||||
|  |  | ||||||
| In any case, thank you very much for your contributions! | In any case, thank you very much for your contributions! | ||||||
|  |  | ||||||
|   | |||||||
| @@ -77,6 +77,7 @@ | |||||||
|  - **BleacherReportCMS** |  - **BleacherReportCMS** | ||||||
|  - **blinkx** |  - **blinkx** | ||||||
|  - **Bloomberg** |  - **Bloomberg** | ||||||
|  |  - **BokeCC** | ||||||
|  - **Bpb**: Bundeszentrale für politische Bildung |  - **Bpb**: Bundeszentrale für politische Bildung | ||||||
|  - **BR**: Bayerischer Rundfunk Mediathek |  - **BR**: Bayerischer Rundfunk Mediathek | ||||||
|  - **Break** |  - **Break** | ||||||
| @@ -560,7 +561,6 @@ | |||||||
|  - **southpark.de** |  - **southpark.de** | ||||||
|  - **southpark.nl** |  - **southpark.nl** | ||||||
|  - **southparkstudios.dk** |  - **southparkstudios.dk** | ||||||
|  - **Space** |  | ||||||
|  - **SpankBang** |  - **SpankBang** | ||||||
|  - **Spankwire** |  - **Spankwire** | ||||||
|  - **Spiegel** |  - **Spiegel** | ||||||
| @@ -620,6 +620,7 @@ | |||||||
|  - **TMZ** |  - **TMZ** | ||||||
|  - **TMZArticle** |  - **TMZArticle** | ||||||
|  - **TNAFlix** |  - **TNAFlix** | ||||||
|  |  - **TNAFlixNetworkEmbed** | ||||||
|  - **toggle** |  - **toggle** | ||||||
|  - **tou.tv** |  - **tou.tv** | ||||||
|  - **Toypics**: Toypics user profile |  - **Toypics**: Toypics user profile | ||||||
| @@ -670,6 +671,7 @@ | |||||||
|  - **Urort**: NRK P3 Urørt |  - **Urort**: NRK P3 Urørt | ||||||
|  - **ustream** |  - **ustream** | ||||||
|  - **ustream:channel** |  - **ustream:channel** | ||||||
|  |  - **Ustudio** | ||||||
|  - **Varzesh3** |  - **Varzesh3** | ||||||
|  - **Vbox7** |  - **Vbox7** | ||||||
|  - **VeeHD** |  - **VeeHD** | ||||||
| @@ -685,7 +687,7 @@ | |||||||
|  - **video.mit.edu** |  - **video.mit.edu** | ||||||
|  - **VideoDetective** |  - **VideoDetective** | ||||||
|  - **videofy.me** |  - **videofy.me** | ||||||
|  - **VideoMega** (Currently broken) |  - **VideoMega** | ||||||
|  - **videomore** |  - **videomore** | ||||||
|  - **videomore:season** |  - **videomore:season** | ||||||
|  - **videomore:video** |  - **videomore:video** | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
|  |  | ||||||
| __version__ = '2016.02.22' | __version__ = '2016.02.27' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Philipp Hagemeister
					Philipp Hagemeister