Commit Graph

837 Commits (83e9374464fc0fba059cc1c9031472579125b46b)

Author SHA1 Message Date
Jaime Marquínez Ferrándiz 0130afb76e [YoutubeDL] format spec: allow grouping specifiers with parentheses
Jaime Marquínez Ferrándiz 5acfa126c8 [YoutubeDL] format spec: treat 'all' like a normal specifier
So you can use filters with it, for example 'all[width>=400][width<=600]'.
Jaime Marquínez Ferrándiz 67134eaba1 [YoutubeDL] rework how the format spec is processed
The spec string is processed using 'tokenize.tokenize' to split it in words and operators, the filters are still processed using regular expressions.
This should make easier to allow grouping operators with parens.
Jaime Marquínez Ferrándiz 4c8fea92f3 [test/aes] Fix on python 3.3 and higher
Since 878563c847 the aes functions only accepts the base64 data as a unicode string.
Yen Chi Hsuan f0bfaa2d7d [nrk] Update subtitles test
Subtitle conversion routine is removed, so the subtitles are TTML now. See
1c7e2e64f6
Yen Chi Hsuan 1b0427e6c4 [utils] Support TTML without default namespace
In a strict sense such TTML is invalid, but Yahoo uses it.
Jaime Marquínez Ferrándiz e9eaf3fbcf [test/YoutubeDL] Add tests for 'playliststart', 'playlistend' and 'playlist_items'
Yen Chi Hsuan 7dff03636a [utils] Support 'dur' field in TTML
Yen Chi Hsuan d39e0f05db [utils] Remove sanitize_url_path_consecutive_slashes()
This function is used only in SohuIE, which is updated to use a new
extraction logic.
Yen Chi Hsuan 0fe2ff78e6 [NBC] Enhance embedURL extraction (closes )
Sergey M․ b3ed15b760 [utils] Add replace_extension
Sergey M․ a4bcaad773 [test_utils] Add tests for prepend_extension
Jaime Marquínez Ferrándiz 8dd5418803 Make 'best' format only match non-DASH formats (closes )
Otherwise it's impossible to only download non-DASH formats, for example `best[height=?480]/best` would download a DASH video if it's the only one with height=480, instead for falling back to the second format specifier.
For audio only urls (soundcloud, bandcamp ...), the best audio will be downloaded as before.
Sergey M. 40b96352c9 Merge pull request from jaimeMF/remove-format-limit
Remove the --max-quality option
Yen Chi Hsuan bf6427d2fb [ffmpeg] Add dfxp (TTML) subtitles support (, )
Jaime Marquínez Ferrándiz 9f3fa89f7c Remove the --max-quality option
It doesn't work well with 'bestvideo' and 'bestaudio' because they are usually before the max quality.
Format filters should be used instead, they are more flexible and don't require the requested quality to exist for each video.
Sergey M․ 70947ea7b1 [parameters.json] Set default `format` parameter to `best`
Yen Chi Hsuan 880ee801cf [tests] Allow multi_video to be tested as playlists
Jaime Marquínez Ferrándiz 592e97e855 Postprocessors: use a list for the files that can be deleted
We could only know if we had to delete the original file, but this system allows to specify us more files (like subtitles).
Yen Chi Hsuan 0a1603634b [utils] Remove url_infer_protocol
Yen Chi Hsuan 418c5cc3fc [udn] Add new extractor
Sergey M․ ff02a228e3 [test_execution] Fix test under python 2 @ windows
Sergey M․ 8cf70de428 [test_utils] Add test for unified_strdate
Sergey M․ ba9e68f402 [utils] Drop trailing comma before closing brace
Jaime Marquínez Ferrándiz 157e9e5aa5 [youtube:watchlater] Remove unused properties and fix tests
Naglis Jonaitis 91757b0f37 [utils] Escape all HTML entities written in hexadecimal form
Philipp Hagemeister f5e2efbbf0 [options] Handle special characters in argv (Fixes )
Jaime Marquínez Ferrándiz f9544f6e8f [test/aes] Test aes_decrypt_text with 256 bit
Jaime Marquínez Ferrándiz 5379a2d40d [test/utils] Test xpath_text
Jaime Marquínez Ferrándiz a7d9ded45d [test] Add tests for aes
Jaime Marquínez Ferrándiz 531980d89c [test/YoutubeDL] test match_filter
Jaime Marquínez Ferrándiz f20bf146e2 [test/YoutubeDL] split in two classes
The name was misleading
Jaime Marquínez Ferrándiz 01218f919b [test/http] Add test for proxy support
Sergey M․ 92a4793b3c [utils] Place sanitize url function near other sanitizing functions
Sergey M․ dc03a42537 Merge branch 'sohu_fix' of https://github.com/yan12125/youtube-dl into yan12125-sohu_fix
Jaime Marquínez Ferrándiz 8508557e77 [test/YoutubeDL] Use valid urls
It failed on python 3.4 when building the http_headers field
Jaime Marquínez Ferrándiz 4d1652484f [test/unicode_literals] Don't look into the .git and .tox directories
The .tox directory contains python code that we can't control
Jaime Marquínez Ferrándiz 88cf6fb368 [metadatafromtitle] Some improvements and cleanup
* Remove the 'songtitle' field, 'title' can be used instead.
* Remove newlines in the help text, for consistency with other options.
* Add 'from __future__ import unicode_literals'.
* Call '__init__' from the parent class.
* Add test for the format_to_regex method
Jaime Marquínez Ferrándiz 3946864c8a [vimeo] Use https for all vimeo.com urls
Unfortunately vimeopro.com doesn't support it yet.
Sergey M․ 7e195d0e92 [funnyordie] Add subtitles test
Sergey M․ 2ebfeacabc [utils] Keep dot and dotdot unmodified (Closes )
Sergey M․ f18ef2d144 [utils] Disallow trailing dot in sanitize_path for a path part
Sergey M․ a2aaf4dbc6 [utils] Add sanitize_path
Yen Chi Hsuan 55969016e9 [utils] Add a function to sanitize consecutive slashes in URLs
Philipp Hagemeister 499bfcbfd0 Make sure netrc works for all extractors with login support
Fixes 
Philipp Hagemeister a7440261c5 [utils] Streap leading dots
Fixes , closes 
Philipp Hagemeister 3e675fabe0 [airmozilla] Be more tolerant when nonessential items are missing ()
Philipp Hagemeister 5a42414b9c [utils] Prevent hyphen at beginning of filename (Fixes )
Jaime Marquínez Ferrándiz 25ac63ed71 [rtve] Extract subtitles
Jaime Marquínez Ferrándiz bfc993cc91 Merge branch 'subtitles-rework'
(Closes PR )
Jaime Marquínez Ferrándiz 80970e531b [test/subtitles] Update checksum for Viki
Jaime Marquínez Ferrándiz b7bb76df05 [test/subtitles] Remove some tests
Test only with 'allsubtitles', the language selection is already tested in test_YoutubeDL.py
Jaime Marquínez Ferrándiz 98c70d6fc7 [YoutubeDL] only add normal subtitles to the 'requested_subtitles' field if 'writesubtitles' is True
Jaime Marquínez Ferrándiz ab84349b16 [test/YoutubeDL] Add test for subtitles
Updated the offlinetest make target to not skip it
Jaime Marquínez Ferrándiz 4d17184817 [YoutubeDL] don't set the 'requested_subtitles' without writesubtitles or writeautomaticsub
Philipp Hagemeister 8fb3ac3649 PEP8: W503
Jaime Marquínez Ferrándiz 8807f1277f [theplatform] Convert to new subtitles system
Philipp Hagemeister d305dd73a3 [utils] Fix js_to_json
Previously, the runtime could be atrocious for longer inputs.
Jaime Marquínez Ferrándiz 4f7cea6c53 [viki] Convert to new subtitles system
Jaime Marquínez Ferrándiz afbdd3acc3 [rai] Convert to new subtitles system
Philipp Hagemeister 9789d7535d [xtube] Fix test case
Jaime Marquínez Ferrándiz 01561da142 [nrk] Convert to new subtitles system
Jaime Marquínez Ferrándiz 0af25f784b [mtv] Convert to new subtitles system
Jaime Marquínez Ferrándiz b9b42f2ea0 [npo] Convert to new subtitles system
Jaime Marquínez Ferrándiz 311c393838 [lynda] Convert to new subtitles system
Philipp Hagemeister 3eff81fbf7 [jsinterp] Disable comment support
We need a proper lexer to be able to understand YouTube's code, which contains /* inside of strings.
For now it's sufficient to just disable comment support altogether.

Fixes , fixes , fixes , fixes , fixes .
Closes .
Philipp Hagemeister f21e915fb9 [test/helper] Render info_dict with a final comma
Philipp Hagemeister 6f53c63df6 [test/helper] Only output a newline for forgotten keys if keys are really missing
Jaime Marquínez Ferrándiz 85920dd01d [bliptv] Convert to new subtitles system
Jaime Marquínez Ferrándiz 360e1ca5cc [youtube] Convert to new subtitles system
The automatic captions are stored in the 'automactic_captions' field, which is used if no normal subtitles are found for an specific language.
Jaime Marquínez Ferrándiz a1f2a06b34 [dailymotion] Convert to new subtitles system
Jaime Marquínez Ferrándiz c84dd8a90d [YoutubeDL] store the subtitles to download in the 'requested_subtitles' field
We need to keep the orginal subtitles information, so that the '--load-info' option can be used to list or select the subtitles again.
We'll also be able to have a separate field for storing the automatic captions info.
Jaime Marquínez Ferrándiz 65469a7f8b [vimeo] Convert to new subtitles system
Removed some tests, the behaviour should be checked in a test for the YoutubeDL class
Jaime Marquínez Ferrándiz a504ced097 Improve subtitles support
For each language the extractor builds a list with the available formats sorted (like for video formats), then YoutubeDL selects one of them using the '--sub-format' option which now allows giving the format preferences (for example 'ass/srt/best').
For each format the 'url' field can be set so that we only download the contents if needed, or if the contents needs to be processed (like in crunchyroll) the 'data' field can be used.

The reasons for this change are:
* We weren't checking that the format given with '--sub-format' was available, checking it in each extractor would be repetitive.
* It allows to easily support giving a format preference.
* The subtitles were automatically downloaded in the extractor, but I think that if you use for example the '--dump-json' option you want to finish as fast as possible.

Currently only the ted extractor has been updated, but the old system still works.
Jaime Marquínez Ferrándiz 8fb474fb17 [test/subtitles] Fix some tests
The checksym for the CeskaTelevize subtitles has changed again, so we just test that it has a reasonable length.
Jaime Marquínez Ferrándiz 36e7a4ca2e [test/subtitles] Update checksums
Jaime Marquínez Ferrándiz d304209a85 [test/parameters.json] Set 'fixup' to 'never'
The fixed audio files for Youtube have a size lower that the minimum required.
Philipp Hagemeister 6a78740211 [test/test_youtube_signature] Use fake YDL
Philipp Hagemeister 347de4931c [YoutubeDL] Add generic video filtering (Fixes )
This functionality is intended to eventually encompass the current format filtering.
Jaime Marquínez Ferrándiz 0161353d7d [test/test_YoutubeDL] Remove debug print call
Jaime Marquínez Ferrándiz 2b4ecde2c8 [test/YoutubeDL] Add a simple test for postprocesors
Just checks that the 'keepvideo' option works as intended.
Philipp Hagemeister 9bb8e0a3f9 [wsj] Add new extractor (Fixes )
Philipp Hagemeister 23d9ded655 [franceculture] Rewrite for new HTML scheme (Fixes )
Philipp Hagemeister 8f4b58d70e [ntvde] Add new extractor (Fixes )
Philipp Hagemeister 9e3f19919a [jsinterp] Beef up and add tests
In preparation for , extend jsinterp by a lot. (We may even have to/want to write a proper interpreter with actual parsing)
Philipp Hagemeister 4e980275b5 [test_download] Remove references to "file" in test definitions
Philipp Hagemeister dc35bfd2d5 [test/helper] Clarify which keys have to be added
Philipp Hagemeister 03d8d4df38 [test_http] PEP8
Philipp Hagemeister 83fda3c000 Add a test for --no-check-certificate
Philipp Hagemeister 7d346331b5 [audiomack:album] Update testcase
Philipp Hagemeister cfb56d1af3 Add --list-thumbnails
Philipp Hagemeister 61ca9a80b3 [generic] Add support for BOMs (Fixes )
Philipp Hagemeister 083c9df93b [YoutubeDL] Allow filtering by properties (Fixes )
Philipp Hagemeister 78111136db [twitch] Move URL matching tests into extractor
Philipp Hagemeister 650ab5beeb [comedycentral:shows] Remove references to colbert report
Naglis Jonaitis a69801e2c6 [utils] Add additional format to unified_strdate
Sergey M․ a5fb718c50 [test_utils] Add more tests for parse_duration
Philipp Hagemeister 2aeb06d6dc [utils] Improve colon handling (Fixes )
Philipp Hagemeister dd622d7c4e [netzkino] Add new extractor (Fixes )
Philipp Hagemeister 5fbf25a681 [test_age_restriction] remove misbehaving test
We now test for the age_limit being set right in test_download, so we don't need more than two tests for the actual age limit handling.
Philipp Hagemeister 0217c78377 [YoutubeDL] Allow selection by more extensions
Philipp Hagemeister bec2248141 [InfoExtractor/common] Correct and test meta tag matching
Philipp Hagemeister e4a8eae701 Merge commit '8ee3415'
Philipp Hagemeister 0590062925 Respect age_limit when listing extractors (Fixes )
Sergey M․ 0b54a5b10a [ceskatelevize] Add subtitles tests
Philipp Hagemeister c11125f9ed [tests] Remove format 138 from tests ()
Jaime Marquínez Ferrándiz 7d900ef1bf [youtube] Add support for automatically translated subtitles (fixes )
They have a manually uploaded subtitles track and YouTube can transtale it.
Sergey M․ f74b341dde expect_info_dict actual-expected argument consistency
Jaime Marquínez Ferrándiz 2cb5b03e53 [test/test_unicode_literals] Remove duplicated imports
Philipp Hagemeister cae97f6521 Improve and test ffmpeg version detection
Philipp Hagemeister 6cbf345f28 Remove test/write_info_json
This is now covered by every single test_download testcase anyways :)
Philipp Hagemeister da4d4191a9 Merge branch 'master' of github.com:rg3/youtube-dl
Philipp Hagemeister 8bdcb436f9 [test_unicode_literals] Fix test
Philipp Hagemeister 42bdd9d051 [cinchcast] Add new extractor (Fixes )
Philipp Hagemeister 47d7c64274 [test_utils] Make test more realistically ()
Philipp Hagemeister 5f9b83944d [ffmpeg] Improve version check and call it from hls (Fixes )
Philipp Hagemeister e8df5cee12 [minhateca] Fix duration parsing
Philipp Hagemeister 4349c07dd7 [minhateca] Add extractor (Fixes )
Jaime Marquínez Ferrándiz 4472f84f0c [test/test_subtitles] Update checksum for vimeo subtitle file
Philipp Hagemeister 155f9550c0 [test/helper] Fix newlines in output of missing test fields
Philipp Hagemeister dcddc10a50 [test_unicode_literals] Arm unicode_literals check
From now on, the line

from __future__ import unicode_literals

should be contained in every single Python file lest we run into any more 2.x/3.x issues.
Going forward, we're likely to develop on 3.x only and would likely miss subtle bugs otherwise.
Philipp Hagemeister e075a44afb [tests] Remove useless u prefixes
Philipp Hagemeister be64b5b098 [xminus] Simplify and extend ()
Jouke Waleson 9e1a5b8455 PEP8: applied even more rules
Jouke Waleson 8bcc875676 PEP8: more applied
Jouke Waleson 5f6a1245ff PEP8 applied
Philipp Hagemeister 7d4111ed14 Provide guidance when called with a YouTube ID starting with a dash.
Reported at https://news.ycombinator.com/item?id=8648121
Jaime Marquínez Ferrándiz f56875f271 [test/test_compat] Restore the old value of the HOME environment variable
If the test was run before the YoutubeIE tests (for example by running
"nosetests -v test/test_compat.py test/test_download.py -m 'Youtube_1|compat_expand'"),
it wrote the signatures cache to the 'C:\Documents and Settings\тест\Application Data' folder.
It failed due to a problem in the cache code and the write_json_file function (fixed in f03e33b89a622af13fa5275c46b63aaa4814c499)
Philipp Hagemeister fbf94a7815 [swfinterp] Add more builtins and improve static variables
Philipp Hagemeister cd9ad1d7e8 [swfinterp] Basic support for constants (only ints for now)
Philipp Hagemeister 33a266f4ba [swfinterp] Implement charCodeAt
Philipp Hagemeister 8d05f2c16a [swfinterp] Add support for void methods
Philipp Hagemeister eb5376044c [swfinterp] Implement equals opcode
Philipp Hagemeister 3cbcff8a2d [swfinterp] Implement String basics
Philipp Hagemeister e983cf5277 [swfinterp] Interpret yet more opcodes
Philipp Hagemeister 0ab1ca5501 [swfinterp] Better error message
Philipp Hagemeister 4baafa229d [swfinterp] Intepret more multinames
Philipp Hagemeister 7f3e33a147 [swfinterp] Implement member assignment
Philipp Hagemeister a0f59cdcb4 [tests] Modernize
Philipp Hagemeister 6a68bb574a [eporner] Fix duration (Closes )
Philipp Hagemeister 609a61e3e6 [npo] Improve npo.nl (Fixes )
Philipp Hagemeister 4c0924bb24 [utils] Fix intlist_to_bytes in Python 2 ()
Philipp Hagemeister e4bdb37ec6 [spiegel] Add support for embeds
Philipp Hagemeister 3e6e4999ca [test/helper] Improve output
Michael Käufl 498942f187 [test_youtube_signature] Fix import
Broken in commit 8c25f81bee
Philipp Hagemeister 12ea2f30cf [utils] Remove unused get_meta_content function
Philipp Hagemeister 278143df5b [test_compat] Ignore unicode_literals
Jaime Marquínez Ferrándiz ac35c26686 [tests] Don't auto init YoutubeDL
It would print the debug headers for each test.
And nose uses a StringIO object for stdout, which in python 2.x doesn't have the 'encoding' attribute.
Philipp Hagemeister 42f7d2f588 [test_download] Fix import
Philipp Hagemeister 39f0a2a6b7 [test_swfinterp] Correct compilation on modern mxmlc versions
Philipp Hagemeister 8c25f81bee [util] Move compatibility functions out of util
utils is large enough without these compatibility functions.

Everything that is present in newer versions of Python (i.e. with dev Python it's just an import) goes into compat.py .
Everything else (i.e. youtube-dl-specific helpers) goes into utils.py .
Philipp Hagemeister 7d11297f3f Merge branch 'master' of github.com:rg3/youtube-dl
Philipp Hagemeister 6ad4013d40 [drtv] Allow fractional timestamps (Fixes )
Jaime Marquínez Ferrándiz 8abec2c8bb [test_utils] Fix compat_getenv and compat_expanduser tests on python 3.x
Philipp Hagemeister f744c0f398 [test_download] Improve error message
Philipp Hagemeister 70b7e3fbb6 [generic] Add a test case for direct links with broken HEAD ()
Sergey M․ f889cea109 Merge branch 'compat-getenv-and-expanduser' of https://github.com/dstftw/youtube-dl into dstftw-compat-getenv-and-expanduser
Conflicts:
	test/test_utils.py
	youtube_dl/__init__.py
Philipp Hagemeister c64ed2a310 [viddler] Use API
Sergey M 4510d14f0a [twitch] Update tests
Sergey M․ 0ca41c3d9c [walla] Fix typo
Sergey M․ 7bc8780c57 [walla] Fix extractor and add subtitle tests
Philipp Hagemeister e7b6d12254 [utils] Improve and test js_to_json
Philipp Hagemeister 410f3e73ab [utils] Fix js_to_json
Sergey M․ 4644ac5527 [core] Decode environment variables with filesystem encoding (Fixes , Fixes , Fixes )
Introduces compat versions of os.getenv and os.path.expanduser
Philipp Hagemeister c0f64ac689 [test/helper] Improve output of missing test definition dictionaries
Philipp Hagemeister 7a08ad7d59 [test/helper] Modernize
Philipp Hagemeister 99b67fecc5 [arte] Fix upload date extraction
Philipp Hagemeister 6be451f422 [youtube] Remove swf signature test cases
These files are now 0 Bytes
Philipp Hagemeister 9c44d2429b [vimeo:likes] Support large like lists (Fixes )
Philipp Hagemeister d6e6a42256 [vimeo:likes] Add new extractor (Fixes )
Philipp Hagemeister cdc628a498 [youtube] Move more tests to extractors
Philipp Hagemeister 0003a5c416 Merge remote-tracking branch 'dstftw/escape-non-ascii-in-urls'
Conflicts:
	test/test_utils.py
Philipp Hagemeister a020a0dc20 [facebook] Fix support for untitled videos (Fixes )
Sergey M․ d05cfe0600 [YoutubeDL/utils] Clarify rationale for URL escaping in comment, move escape routines to utils and add some tests
Philipp Hagemeister 9291475f7d [youtube] Move more tests to Playlist IE, and simply suitable.
Philipp Hagemeister 5df921b0e3 [test_cache] Add a dot in the file name
Philipp Hagemeister a0e07d3161 [youtube] Move cache into its own module
Philipp Hagemeister 7260ea0705 [comedycentral] Move tests to the extractor itself
Sergey M․ ca7b3246b6 [utils] Improve parse_duration
Sergey M․ 08a36c3569 [test_download] Check expected file minsize and md5 only when download is not skipped
Philipp Hagemeister 753727cded [test_download] Expect a minimum file size
This should detect when we're downloading a small text file by accident.
Philipp Hagemeister 22a6f15061 Move playlist tests to extractors.
From now on, test_download will run these tests. That means we benefit not only from the networking setup in there, but also from the other tests (for example test_all_urls to find problems with _VALID_URLs).
Philipp Hagemeister 4e408e479b [utils] Modernize tests
Philipp Hagemeister 2857084000 [test_download] Improve playlist handling
Philipp Hagemeister 2929b3e71d [vimeo] Move all testcases to extractors and clean up
Previously, these extractors all defined their own suitable methods.
No test_all_urls tests that everything is in order, automatically :)
Philipp Hagemeister 22449fa624 Improve test_all_urls output
Philipp Hagemeister 0990305d2a [generic] Fix rss under Python 2.x and move test to extractor
Philipp Hagemeister 829476b80a [googlesearch] Move test to extractor
Philipp Hagemeister 7adcbe7594 [rtlnl] Extract duration
Philipp Hagemeister 28028629b9 [gameone:playlist] Move test to extractor
Philipp Hagemeister 11f75cac3d Merge remote-tracking branch 'olebowle/gameone'
Philipp Hagemeister a053c3493a [test_YoutubeDL] Reorder formats ()
Philipp Hagemeister 266c71f971 Deprecate test_playlists
Philipp Hagemeister e8ee972c6e Allow playlist test definitions in test_download.
This moves playlist tests where they belong, i.e. to the extractors themselves.
Additionally, all our network interaction configuration for tests in test_download now applies to playlist tests as well.
Jaime Marquínez Ferrándiz a6da7b6b96 [facebook] Allow '?' before '#!' (fixes )
Jaime Marquínez Ferrándiz 173a7026d5 [test/test_utils] Fix typo in method name
Sergey M․ a954584f63 [bandcamp] Replace 404 playlist test
Philipp Hagemeister 4bc7009e8a [jsinterp] Add new testcase
Philipp Hagemeister 42f4dcfe41 [test_youtube_signatures] Modernize
Jaime Marquínez Ferrándiz ebe832dc37 [jsinterp] 'reverse' modifies the array in place (fixes )