1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00
Commit Graph

258 Commits

Author SHA1 Message Date
Harald Gustafsson
073f26e618 Added broadcast/publishing datetime to metadata extraction and NFO file creation. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
4388e57112 Move the new metadata based thumbnail download into a reusable class instead of directly in Svtplay (requires that the service extract thumbnail urls during parsing of the video info into the self.output variable and the keys 'showthumbnailurl' and 'episodethumbnailurl'). Change OpenGraphThumbMixin to use the new download_thumbnails which makes correct filenames. Removed the old download_thumbnail. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
fc71a8d8e4 flake8 fixes. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
c15d7607eb Create NFO files with the extracted metadata. TVshows get a tvshow.nfo file as well. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
184f79a377 Option to automatically create a subfolder for tvshows, named as the show title. When not a series will use a subfolder titled movies. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
bf0e38a6f9 Working thumbnail download. Used by svtplay and barnkanalen, downloads both episode and show thumbnails. 2018-09-05 21:43:52 +02:00
Harald Gustafsson
71b40f975a Fix bug that get_thumbnail could never be called, due to overwrite of the stream variable. 2018-09-05 21:43:52 +02:00
Johan Andersson
a6e2bae955 utils.stream: remove some debug prints 2018-09-05 16:40:56 +02:00
Johan Andersson
d693e16596 get_multiple_media: this should be config 2018-07-16 21:21:18 +02:00
Johan Andersson
e377ee7386 output: --force should work on subtitles too 2018-07-05 01:26:43 +02:00
Johan Andersson
a0ab26a939 utilis.http: move get_full_url from hls to http 2018-07-05 01:26:43 +02:00
Johan Andersson
d61e5793e6 use which from stdlib instead our own version 2018-07-05 01:26:43 +02:00
Johan Andersson
8b54c05ca8 getmedia: use logging instead of log 2018-06-24 16:14:57 +02:00
Johan Andersson
138995925e _formatname: check if we have season in output 2018-06-03 18:03:09 +02:00
Johan Andersson
2a94b927d0 _formatname: in some cases we dont have the episode and only season.
we want to have like "name.s01.new.stuff.service.id.ext"
its better than "name.new.stuff.service.id.ext"
2018-06-03 15:48:48 +02:00
Johan Andersson
fa3b16bfcd get_one_media: use logging instead of log. 2018-06-03 12:49:49 +02:00
Johan Andersson
276b55dc8c get_one_media: we get the config nowadays 2018-06-03 00:12:15 +02:00
Johan Andersson
12021ee355 get_one_media: dont try to run exclude on exceptions 2018-05-31 01:30:25 +02:00
Johan Andersson
d69244d39c merge: dont try to merge when new is None 2018-05-26 01:26:30 +02:00
Johan Andersson
526c6bbdbe get_one_media: always remux hls
fixes #903
2018-05-25 22:49:05 +02:00
Johan Andersson
bbf2f82b79 fetcher: make name a property 2018-05-25 22:47:26 +02:00
Johan Andersson
dea461c198 get_one_media: instead of using hardcoded name of fetcher check for audio 2018-05-24 21:18:14 +02:00
Johan Andersson
30f09b4bad output: we can have separate a/v stream in .ts but there is no extension to separate them
fixes: #902
2018-05-24 21:15:14 +02:00
Johan Andersson
b77b78b121 output: dont try to check empty values 2018-05-21 23:37:00 +02:00
Johan Andersson
8b340bb103 get_media: use config inside of stream 2018-05-20 21:09:49 +02:00
Johan Andersson
a8fa7a8aa3 get_media: we already have this code in parser 2018-05-20 21:05:24 +02:00
Johan Andersson
2605f4ff94 output.formatname: this should be path 2018-05-20 20:51:34 +02:00
Johan Andersson
600afef12b parser.setup_default: add missing default values 2018-05-20 20:29:16 +02:00
Johan Andersson
c41dba7077 parser.merge: rewrite and dont update items with std values 2018-05-20 20:28:49 +02:00
Johan Andersson
2e0bf58a3f parser: this can be on one line 2018-05-20 19:05:35 +02:00
Johan Andersson
e97b104573 unused imports 2018-05-20 19:05:17 +02:00
Johan Andersson
6dfdc8c6c0 Support for config files
this will search for config file in
unix: ~/.svtplay-dl.yaml
windows: %APPDATA%\svtplay-dl\svtplay-dl.yaml
2018-05-20 18:21:40 +02:00
Johan Andersson
2543ed7f46 move some special config values to parser 2018-05-20 13:16:00 +02:00
Johan Andersson
d2776c3b12 Remove some debug prints 2018-05-13 13:18:36 +02:00
Johan Andersson
8192fe025d getmedia: right import path to which 2018-05-13 13:18:36 +02:00
Johan Andersson
836084f1fb output: user should be able to set its own output name 2018-05-13 13:18:36 +02:00
Johan Andersson
9a2aafefda parser: set output to None 2018-05-13 13:18:36 +02:00
Johan Andersson
335ff16c8c output: fix detection of already downloaded files 2018-05-13 13:09:27 +02:00
Johan Andersson
bf21419afd output.formatname: this should be ints 2018-05-13 13:09:27 +02:00
Johan Andersson
850ec4612d getmedia: do exclude inside of the streams loop. 2018-05-13 13:09:25 +02:00
Johan Andersson
d3841e17da options to commit 2018-05-13 13:08:24 +02:00
Johan Andersson
f300e24ca3 more options to config replaces 2018-05-13 13:07:34 +02:00
Johan Andersson
ca49366002 Options to config 2018-05-13 13:06:45 +02:00
Johan Andersson
28dcc90d7e flake8 fixes 2018-05-13 12:10:19 +02:00
Johan Andersson
a051418dab utils: move functions out of init to its own files. 2018-05-13 12:10:19 +02:00
Johan Andersson
8f126c3d49 flake8 add new line end of file 2018-05-13 12:09:27 +02:00
Johan Andersson
5d1f86d8fc flake8 fixes 2018-05-13 12:09:27 +02:00
Johan Andersson
903a4ae71d No need for utils.io 2018-05-13 12:09:27 +02:00
Johan Andersson
7e351530e9 No need for utils.urllib anymore 2018-05-13 12:09:27 +02:00
Johan Andersson
a6c4de8d9d flake fix 2018-05-13 12:09:27 +02:00
Johan Andersson
b82831df03 Move services to its own file 2018-05-13 12:09:27 +02:00
Johan Andersson
d496955cb4 Move Options to parser? 2018-05-13 12:09:27 +02:00
Johan Andersson
03c8b68bb6 Move get_* to its own file 2018-05-13 12:09:27 +02:00
Johan Andersson
3da6728ae3 move mergeparseroption to parser.py 2018-05-13 12:08:11 +02:00
Johan Andersson
c135ed3593 move parser to its own file 2018-05-13 12:08:11 +02:00
Johan Andersson
b8c1163852 remove a bunch of is_py. time for py3. 2018-05-13 12:08:11 +02:00
Johan Andersson
fbb511981e select_quality: this should be get and not pop 2018-03-10 10:09:26 +01:00
Johan Andersson
aff4a0716a select_quality: Sometimes cookies is not present in the stream
fixes: #858
2018-03-10 09:56:32 +01:00
Johan Andersson
0eaf0ec8f8 don't hide import errors 2018-03-09 22:53:33 +01:00
Johan Andersson
24213562ad postprocess: try to detect the bad audio track and skip it
this will only work for files with one audio track.
i have never seen file with several
fixes #814
2018-03-04 11:41:22 +01:00
dalgr
848dc12a3a Fix for issue 833, not abble to download hds streams 2018-03-04 11:26:30 +01:00
dalgr
da5ec62241 Improve preformance of hls parser, skip checking all posible videos 2018-02-04 20:40:25 +01:00
Johan Andersson
7b6ceb4737 Flake8 fixes 2018-01-30 20:17:33 +01:00
dalgr
709618068e Add default value for 'hls_time_stamp', Add live protocol prio 2018-01-23 19:01:40 +01:00
Robert Foss
c26bb3ccc5 Add proxy support
This feature utilises the proxy support of the requests module, and
has been tested with SOCKS5 through a SSH tunnel, and has been
verified to be working.

Signed-off-by: Robert Foss <robert.foss@memcpy.io>
2017-11-26 18:11:41 +01:00
dalgr
328ad0cff9 Change 'subprocess.check_call' to 'subprocess.check_output' in ''utils.output' 2017-10-10 22:25:09 +02:00
dalgr
bbc8e50352 retries with requests, for all 'self.http.request' 2017-10-09 20:32:16 +02:00
Johan Andersson
f7e6d2e77c utils: remove the try except from request.
this might cause some other issue. we will see.
2017-09-17 19:43:14 +02:00
Johan Andersson
fa590117de fetcher: handle errors from parsing playlists 2016-10-16 19:35:38 +02:00
Johan Andersson
23814a9bf5 select_quality: fix crash while using range
fixes: #392
2016-05-14 11:17:34 +02:00
Johan Andersson
0fe57c52a2 select_quality: support for range to -q
this is similar to -Q  but instead its -q 2000,3000  . it will choose one in between
fixes: #372
2016-04-26 23:48:12 +02:00
Olof Johansson
5393dc1929 Fix various pylint warnings
None of these were any real problems, but easier to spot real issues if pylint
is a bit quieter. Apart from the pylint overrides being sprinkled over the code
base, this commit also fixes occurences of the following issues:

 - logging-not-lazy
 - logging-format-interpolation
 - unused-import
 - unused-variable
2016-04-03 19:06:45 +02:00
Olof Johansson
fa66beff9b select_quality: Simplify and add comments 2016-03-31 20:33:44 +02:00
Olof Johansson
f59207302d prio_streams: Rename to protocol_prio 2016-03-31 20:33:44 +02:00
Olof Johansson
84ca17a14c select_quality: Replace sys.exits with UIExceptions 2016-03-31 20:19:44 +02:00
Olof Johansson
dad2790d9e select_quality: Filter out unwanted protocols before bitrate
It was easily possible to end up in a state where the bitrate prioritization
wanted a bitrate only avaiable via protocols outside of our set of accepted
protocols, like trying to disable dash for svtplay. By doing the protocol
filtering first, we end up only considering "valid" bitrates.
2016-03-31 20:19:44 +02:00
Olof Johansson
9d2054b4bc select_quality: handle when no requested proto is available
Needs to widen the scope of the try: catch block in svtplay_dl/__init__.py
a little, since select_quality can now also fire away UIExceptions.
2016-03-31 20:19:44 +02:00
Olof Johansson
a6e05e4502 prio_streams: make protocol_prio param mandatory
Move the responsibility for extracting it to select_quality (prio_streams'
caller). This makes the prio_streams function simpler.

And at the same time, move the default protocol_prio list to global scope. This
can for instance be used for improved error reporting.
2016-03-31 20:19:44 +02:00
Olof Johansson
b6541100a3 select_quality: fix argument parsing
Instead of parsing the argument to --stream-prio as a comma separated listed, it
was accidentally handled as a space separated list.
2016-03-31 20:19:44 +02:00
Johan Andersson
e523141a04 support for dash streams 2016-03-26 21:38:31 +01:00
Johan Andersson
4c8cb7c5d2 which: detect if you have the app in your cwd 2016-03-22 23:31:07 +01:00
Johan Andersson
bb861a4062 utils: implement a function to find program in path 2016-03-22 22:28:07 +01:00
Johan Andersson
8da9cab05b filenamify: dont remove the char before and after - 2016-03-17 16:57:12 +01:00
Johan Andersson
05b245dfaa filenamify: replace .-. with only - 2016-03-16 22:51:19 +01:00
Olof Johansson
4740a42050 prio_streams: remove selected from parameters
Moving the responsibility for filtering out "unwanted" bitrates,
as opposed to just present a prioritized list, makes writing
unit tests easier.
2016-03-13 16:56:51 +01:00
Olof Johansson
fe23b971a5 prio_streams: remove options from parameters
Instead, pass the protocol prio list; this was the only reason
we used to pass options. Removing options makes it easier to
unit test.
2016-03-13 16:56:51 +01:00
Olof Johansson
af298e86d9 prio_streams: fix issues with prioritization
Previously, prio_streams didn't correctly account for the protocol,
and we ended up with HDS videos by default, instead of HLS as exected,
because HDS sorts before HLS alphabetically.

Fixes #349
2016-03-13 16:56:51 +01:00
Johan Andersson
f047331b8c pylint fixes 2016-02-29 23:19:01 +01:00
Johan Andersson
3f04ae2a56 swap place on py2 and py3 checks 2016-01-27 19:49:38 +01:00
Johan Andersson
f4b32cb1df Merge pull request #326 from olof/filenamify_improvements
filenamify: disallow shell metachars + improvements
2016-01-10 20:36:07 +01:00
Olof Johansson
7803472713 utils: specify utf-8 encoding in editor modelines 2016-01-10 15:03:45 +01:00
Olof Johansson
f4005505d9 filenamify: Simplify and add unittests 2016-01-10 15:03:45 +01:00
Olof Johansson
9689dc78b0 filenamify: Make title regexp stricter
The - character is a range operator when used in character classes
(e.g. [0-9]). In our case, we want it to match a literal - (which it
coindicentally does, since it's within the range [ -.]. But we don't
want it to match other characters within this range.
2016-01-10 14:33:22 +01:00
Johan Andersson
9dcf203923 option to select which type of streams you prefer
fixes #321
2016-01-03 16:15:27 +01:00
Johan Andersson
eb7bd48d5a utils.http: support for custom headers
fixes: #209
2015-12-26 13:38:36 +01:00
Johan Andersson
ff0ce41b72 utils: update the user-agent 2015-12-26 13:35:55 +01:00
Johan Andersson
ef74148003 Option to not verify ssl certificate 2015-12-26 12:14:14 +01:00
Olof Johansson
270a64c6af Fix docstring after the filenamify changes (f3aba4e59)
This caused the test suite to fail because of doctest.
2015-10-25 19:49:03 +01:00
Johan Andersson
c453f7c48b filenamify: remove “ and ‘
fix #289
2015-10-25 01:29:04 +02:00
Johan Andersson
43dd5f4b2d http.request: dont send headers twice 2015-10-24 21:18:23 +02:00
Johan Andersson
f3aba4e598 filenamify: replace with dot instead of dash 2015-10-19 10:37:15 +02:00
Johan Andersson
64b2ac0240 utils.request: send chrome user-agent instead of the default one 2015-10-04 14:33:08 +02:00
Johan Andersson
dc2cc0294c pip8. expected 2 lines found 1 2015-09-15 20:10:32 +02:00
Johan Andersson
29d00920ad utils: show an error message if requests is not found 2015-09-13 22:05:17 +02:00
Johan Andersson
80a55e2615 utils: unused import 2015-09-13 22:04:47 +02:00
Johan Andersson
1057f800b0 request: only show what request we are getting. 2015-09-07 20:13:36 +02:00
Johan Andersson
06472b5012 utils: remove unused imports 2015-08-31 20:35:23 +02:00
Johan Andersson
ea70ec30bf urllib: remove unused imports 2015-08-31 20:35:05 +02:00
Johan Andersson
331de0a70f replace self.http.get with our own function with debug info 2015-08-31 19:45:15 +02:00
Johan Andersson
a1e987348d download_thumbernail: use request instead 2015-08-30 12:04:49 +02:00
Johan Andersson
f416a17572 ensure_unicode: remove extra space 2015-08-30 00:08:24 +02:00
Johan Andersson
84ee181f5b adding request support.
still need some more work
2015-08-30 00:06:20 +02:00
Johan Andersson
679f40cf35 io: use StringIO instead of BytesIO 2015-04-28 22:58:02 +02:00
Anders Waldenborg
101354ed7e Add urljoin to svtplay_dl.utils.urllib 2015-03-07 10:42:48 +01:00
Johan Andersson
8f89b00c5e unused imports 2015-01-25 14:41:29 +01:00
Johan Andersson
6a374ffa06 Move hdcore check to utils/get_http_data 2015-01-18 18:01:41 +01:00
Johan Andersson
b09b4c17f5 main: --list-quality option 2015-01-05 22:40:40 +01:00
Johan Andersson
d152e02d06 filenamify: dont remove dot 2014-12-28 13:57:11 +01:00
Johan Andersson
d7d8297811 pylint fixes 2014-12-26 02:04:29 +01:00
Johan Andersson
e273fd0abc get_http_data: send postdata in the argument for Request 2014-12-15 12:33:49 +01:00
Johan Andersson
67b3c8bb54 Rewrite http request handling. 2014-12-08 23:07:02 +01:00
Johan Andersson
e1e56773cb get_http_data: remove try-except-clause 2014-11-25 19:03:23 +01:00
Johan Andersson
1ce469e4f0 select_quality: in some cases we don’t know quality and return 0.
because of the 0 we then fail and show and error message when we shouldn’t.
this fixes #133
2014-09-28 23:32:57 +02:00
Olof Johansson
ad98867700 utils: ignore pylint import-error warning
This is a python3 fallback.
2014-07-22 10:19:10 +02:00
Johan Andersson
a52fbe6985 select_quality: move preferred option to get_one_media 2014-07-13 16:03:03 +02:00
Johan Andersson
d9b945bf9e select_quality: print the fetcher name after bitrate. 2014-07-13 15:12:06 +02:00
Johan Andersson
4b9b40c9f4 output: better progress width handling 2014-06-26 22:55:54 +02:00
Johan Andersson
e87c236c51 option to choose which download method is preferred. 2014-06-02 21:27:51 +02:00
Johan Andersson
2eb9af443a select_qualtiy: it wants ints. 2014-06-02 21:27:50 +02:00
Johan Andersson
a857f1d906 get_one_media: select quality 2014-06-02 21:27:50 +02:00
Johan Andersson
4e69ebdf39 utils: forgot to remove the subtiles from the old file 2014-06-02 21:27:49 +02:00
Johan Andersson
3dc633df12 subtitle: When we only see the name without extension, add .srt to it. 2014-03-21 21:01:00 +01:00
Johan Andersson
2cece32246 subtitle_sami: this fixes #74 2014-03-11 16:05:32 +01:00
Johan Andersson
81f1f49301 subtitle_json: fixing #73 2014-03-11 16:04:38 +01:00
Olof Johansson
e8dc4781db urllib: export quote (url encoding) 2014-02-08 17:10:58 +01:00
Johan Andersson
7010adc6e6 utils: use FIREFOX_UA in check_redirect 2014-01-25 23:53:09 +01:00
Anders Waldenborg
b1871b3834 Add --thumbnail
Names thumbnails as $basename.tbn (Hi xbmc!)
2014-01-25 22:57:50 +01:00
Anders Waldenborg
dcf4c1bd23 Add doctests for new functions in utils
The print call is there to make it py2/3 compatible (py2 adds u'' where py3 just adds '')
2014-01-25 22:57:49 +01:00
Anders Waldenborg
9d3ffd07d8 Fix reverse logic in io 2014-01-25 22:57:49 +01:00
Anders Waldenborg
d6ab73679e Improve title to filename conversion.
Does unicode NFD decomposition on the string before stripping non ascii chars.

This means that chars like 'ü' is decomposed into 'u' and '¨', which mean that
when non-ascii chars are dropped we will still keep the 'u'.

Fixes #60
2014-01-25 22:57:37 +01:00
Anders Waldenborg
712901cc8e Decode html entities in title tag 2014-01-25 13:01:01 +01:00
Anders Waldenborg
0671b2418e Display http request urls and time with --verbose 2014-01-25 13:01:01 +01:00
Johan Andersson
9345284547 Make pylint bit happier 2013-12-30 01:43:59 +01:00
Johan Andersson
cceb60f8b3 get_http_data: use space instead of tab one line 2013-12-30 01:37:13 +01:00
Johan Andersson
33bb2c5c13 Replace sys.version_info with pyX 2013-12-30 01:35:08 +01:00
Johan Andersson
4348b93167 subtitle_tt: urplay changed from dur till duration 2013-10-28 20:16:12 +01:00
Johan Andersson
8a72d889b8 subtitle_tt: make up an end time when it does not exists.
In some streams end time does not exists.
so we make our own from beginning + duration.
2013-09-15 00:28:23 +02:00
Johan Andersson
2bf02d1a2b utils: remove old comment 2013-08-15 16:36:38 +02:00
Johan Andersson
dcf140475d utils: refactor get_http_data 2013-08-13 20:06:46 +02:00
Johan Andersson
979b8c43f7 subtitle_sami: remove an extra space in the beginning 2013-08-10 20:29:06 +02:00