1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-24 03:32:33 +01:00
Commit Graph

28 Commits

Author SHA1 Message Date
Mike Fährmann
f2d6b3e6b4
run tests without using 'nose'
run_tests.sh -> run_tests.py
2021-10-13 04:07:41 +02:00
Mike Fährmann
40eb8025cc
require an argument for --clear-cache 2021-06-12 00:15:25 +02:00
Mike Fährmann
755164b36a
improve --clear-cache (#1230)
Allow for an optional argument to only delete cached entries from
a specific module.

delete all cache entries
$ gallery-dl --clear-cache
or
$ gallery-dl --clear-cache all

only delete entries for instagram
$ gallery-dl --clear-cache instagram
2021-05-04 19:27:17 +02:00
Mike Fährmann
511d8d3fa3
increase SQLite connection timeouts (#1173) 2020-12-19 20:15:07 +01:00
Mike Fährmann
da22ea8ced
use %APPDATA%\gallery-dl for config/cache on Windows 2020-05-28 02:56:38 +02:00
Mike Fährmann
3201fe3521
add global SENTINEL object 2020-05-19 22:32:53 +02:00
Mike Fährmann
c8787647ed
add global WINDOWS bool 2020-05-19 22:32:53 +02:00
Mike Fährmann
8b60bd6a91
mock 'time()' in cache tests
instead of calling 'sleep()' to let time advance.

This shortens the time needed to run those tests,
and ensures consistent results.
(Tests would randomly fail when using 'sleep()')
2020-05-09 23:55:14 +02:00
Mike Fährmann
ec85bf90de
use context managers in cache.py & add tests 2020-02-25 23:08:47 +01:00
Mike Fährmann
34887ae139
fix bugs in DatabaseCacheDecorator.update()/.invalidate()
- call db.commit() after changes have been made
- remove 'LIMIT 1' from the DELETE statement in invalidate()
    (only available if SQLite3 was compiled with the right flags
     enabled, syntax error otherwise)
2020-02-23 21:04:36 +01:00
Mike Fährmann
43ab9572b4
[twitter] handle API rate limits (#526) 2020-01-04 23:46:29 +01:00
Mike Fährmann
f5604492c3
update interface of config functions 2019-11-24 00:42:28 +01:00
Mike Fährmann
0609afd1e4
update default cache directory ... again
Use a 'gallery-dl' subdirectory in ~/.cache to adhere to how other
programs store their cached data, and call os.makedirs() so it also
works without an existing ~/.cache directory.
2019-08-01 22:11:00 +02:00
Mike Fährmann
a8b60b2bd9
change default cache directory for unix systems
Use either $XDG_CACHE_HOME or ~/.cache (if the former isn't set)
and store potentially sensitive cookies and tokens in a user's
home directory and not in the world-readable /tmp.
2019-07-31 22:56:14 +02:00
Mike Fährmann
4b6edfbfd2
restrict permissions without importing 'pathlib'
and only on non-Windows systems.

1. On Windows the 'mode' argument for os.open() has no (visible) effect
   on access permissions for new files.
2. The default location for 'cache.file' on Windows is in
   %USERPROFILE%\AppData\Local\Temp which can only be accessed by the
   owner himself (or an admin).
2019-07-31 21:48:09 +02:00
Leonardo Taccari
afce1ee1eb
Avoid possible sensitive information disclosure via cache.file
Previously cache.file could be created world readable leading to
possible sensitive information disclosure on multi-user systems.
Restrict permissions only to the owner by creating an empty file.

Please note that cache.file created before this commit may need a
`chmod 600' or similar!
2019-07-31 15:05:26 +02:00
Mike Fährmann
bc26fc2439
implement '--clear-cache'
Effectively clears all cached values from the cache database by
executing "DELETE FROM data" without any further user input.
2019-04-25 21:31:01 +02:00
Mike Fährmann
34ea0d6a10
rewrite cache module
less complexity, better performance,
but some duplicate code here and there
2019-03-14 15:55:48 +01:00
Mike Fährmann
2221cf97ff
implement 'update()' for caches 2018-10-12 22:18:29 +02:00
Mike Fährmann
ea8ca4cfa4
add 'util.expand_path()' 2017-10-26 00:04:28 +02:00
Mike Fährmann
e3212dd98f
fix some smaller stuff
- remove support for old windows config paths
- catch exception if cache-database can't be opened
- fix username/password settings for unit tests
- rename variable 'max_tries' to 'retries'
2017-03-27 14:30:32 +02:00
Mike Fährmann
4f123b8513
code adjustments according to pep8 2017-01-30 19:40:15 +01:00
Mike Fährmann
989820d719
workaround for python 3.6s behaviour with BEGIN EXCLUSIVE in sqlite 2017-01-11 00:34:32 +01:00
Mike Fährmann
1e0cf8ddcc
implement a method to manually invalidate cached values 2016-11-22 17:57:41 +01:00
Mike Fährmann
e12862520d
expand path for cache database 2016-09-23 08:23:04 +02:00
Mike Fährmann
b0c333b799
rewrite cache module 2016-04-20 08:40:41 +02:00
Mike Fährmann
738c65d54f
add 'keyarg' argument to cache-decorator 2016-03-06 16:05:59 +01:00
Mike Fährmann
b8c6937d39
first draft for a cache-module 2016-03-05 17:49:18 +01:00