diff --git a/.flake8 b/.flake8 index 4b1308a..715915d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,8 @@ [flake8] max-line-length = 100 ignore = - N802, # FIXME: tidy up camel case naming mess then re-enable these - N803, - W503, # Contradicts PEP8 + + E402, # breaks sys.path addition etc + + N818, # Wants 'Error' suffix on exception names \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3ce707b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: CI + +on: + - push + - pull_request + +jobs: + build: + + strategy: + matrix: + python-version: + - '3.9' + - '3.10' + - '3.11' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + + name: Test python ${{ matrix.python-version }} (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dev deps + run: | + pip install codecov + pip install -r requirements-dev.txt + python setup.py develop + - name: Run tests + run: python -m pytest + - name: Upload test results + run: codecov diff --git a/.gitignore b/.gitignore index 4c0e6e2..d16d695 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ dist/*.tar.gz /.mypy_cache /.coverage /htmlcov +.vscode/settings.json +*.sqlite +tests/http_cache/* +.vscode/* +build/* diff --git a/CHANGELOG.md b/CHANGELOG.md index b689562..6cccf62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## `3.2.1` - 2024-06-22 +- Bug fix for `TVDB Api` error `No results for your query: map[]` thrown on a corrupted links section while getting incorrect page total and next page information (by Doudalidou) + + +## `3.2` - 2024-06-21 + +- Dropped support for Python 2. Only maintained versions of Python are supported (currently Python 3.9 onwards) (by Doudalidou) +- Support newer requests-cache version (1.2.1 onwards) (by Doudalidou) + [PR #97](https://github.com/dbr/tvdb_api/pull/97) +- Removed deprecated `tvdb_*` exceptions (e.g `tvdb_error` is now `TvdbError`) +- Remove deprecated `Tvdb(forceConnect=...)` option +- Remove 'search_all_languages' option - had no effect +- Remove `self.log` from custom UI's (which inherit from `BaseUI` etc) + ## `3.1` - 2021-04-29 - Rename exceptions to conventional PEP8 naming syntax, e.g `tvdb_error` becomes `TvdbError`, `tvdb_episodenotfound` becomes `TvdbEpisodeNotFound` etc. All exceptions have changed. Backwards-compatible bindings to old names exist until next version (i.e will be removed in version 3.2) diff --git a/README.md b/README.md index ed0abde..1413263 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ `tvdb_api` is an easy to use interface to [thetvdb.com][tvdb] -It supports Python 2.7, and 3.5 onwards +It supports Python 3.9 onwards `tvnamer` has moved to a separate repository: [github.com/dbr/tvnamer][tvnamer] - it is a utility which uses `tvdb_api` to rename files from `some.show.s01e03.blah.abc.avi` to `Some Show - [01x03] - The Episode Name.avi` (which works by getting the episode name from `tvdb_api`) @@ -28,6 +28,11 @@ You may need to use sudo, depending on your setup: sudo pip install --upgrade tvdb_api +On Debian distro pip have been desactivated outside virtual environement. + + python -m venv /path/to/new/virtual/environment + then proceed with the packe installation via pip + ## Basic usage First initialise an instance of the `Tvdb` class with your API key: @@ -86,7 +91,7 @@ All data exposed by [thetvdb.com][tvdb] is accessible via the `Show` class. A Sh For example, to find out what network Scrubs is aired: >>> t['scrubs']['network'] - u'ABC' + 'ABC' The data is stored in an attribute named `data`, within the Show instance: @@ -96,7 +101,7 @@ The data is stored in an attribute named `data`, within the Show instance: Although each element is also accessible via `t['scrubs']` for ease-of-use: >>> t['scrubs']['rating'] - u'9.0' + '9.0' This is the recommended way of retrieving "one-off" data (for example, if you are only interested in "seriesname"). If you wish to iterate over all data, or check if a particular show has a specific piece of data, use the `data` attribute, @@ -126,9 +131,9 @@ Extended actor data is accessible similarly: >>> actors[0].keys() ['sortorder', 'image', 'role', 'id', 'name'] >>> actors[0]['role'] - u'Dr. John Michael "J.D." Dorian' + 'Dr. John Michael "J.D." Dorian' Remember a simple list of actors is accessible via the default Show data: >>> t['scrubs']['actors'] - u'|Zach Braff|Donald Faison|Sarah Chalke|Judy Reyes|John C. McGinley|Neil Flynn|Ken Jenkins|Christa Miller|Aloma Wright|Robert Maschio|Sam Lloyd|Travis Schuldt|Johnny Kastl|Heather Graham|Michael Mosley|Kerry Bish\xe9|Dave Franco|Eliza Coupe|' + '|Zach Braff|Donald Faison|Sarah Chalke|Judy Reyes|John C. McGinley|Neil Flynn|Ken Jenkins|Christa Miller|Aloma Wright|Robert Maschio|Sam Lloyd|Travis Schuldt|Johnny Kastl|Heather Graham|Michael Mosley|Kerry Bish\xe9|Dave Franco|Eliza Coupe|' diff --git a/pytest.ini b/pytest.ini index 5e5e8b6..fe6d7c3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,10 @@ [pytest] addopts = --cov=tvdb_api - +python_files = test_*.py +python_functions = test_* +log_cli = True +log_cli_date_format = %Y-%m-%d %H:%M:%S +log_cli_level = DEBUG env = TVDB_API_KEY=d48665c58c1a3c3bcd0c78da82df4fab # API key for tvdb_api test use only. New keys can easily be registered at https://thetvdb.com/api-information diff --git a/requirements-dev.txt b/requirements-dev.txt index 0d1b45a..e8aef76 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,9 @@ -pytest==5.4; python_version > '3.0' -pytest==4.6; python_version == '2.7' -coverage -pytest-cov==2.8 -pytest-env==0.6 -flake8==3.8 -pep8-naming==0.10 +pytest>=8.2 +pytest-cov>=5.0 +pytest-env>=1.1 +debugpy +flake8==7.1 +pep8-naming==0.14.0 +coverage==7.5.0 +requests==2.32.3 +requests-cache==1.2.1 diff --git a/setup.py b/setup.py index 606b258..0f05167 100644 --- a/setup.py +++ b/setup.py @@ -13,29 +13,27 @@ setup( name='tvdb_api', - version='3.1.0', + version='3.2.1', author='dbr/Ben', + author_rev='doudalidou/jy', description='Interface to thetvdb.com', - url='http://github.com/dbr/tvdb_api', + url='http://github.com/doudalidou/tvdb_api', long_description=long_description, long_description_content_type='text/markdown', py_modules=['tvdb_api'], - install_requires=['requests_cache', 'requests'], + install_requires=['requests_cache~=1.2.1', 'requests~=2.32.3'], classifiers=[ "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Multimedia", "Topic :: Utilities", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/tests/httpcache/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 b/tests/httpcache/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 deleted file mode 100644 index 85ae5d4..0000000 Binary files a/tests/httpcache/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 and /dev/null differ diff --git a/tests/httpcache/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 b/tests/httpcache/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 deleted file mode 100644 index 55ad98b..0000000 Binary files a/tests/httpcache/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 and /dev/null differ diff --git a/tests/httpcache/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 b/tests/httpcache/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 deleted file mode 100644 index dc03d11..0000000 Binary files a/tests/httpcache/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 and /dev/null differ diff --git a/tests/httpcache/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 b/tests/httpcache/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 deleted file mode 100644 index 5d0b973..0000000 Binary files a/tests/httpcache/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 and /dev/null differ diff --git a/tests/httpcache/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 b/tests/httpcache/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 deleted file mode 100644 index bfc9962..0000000 Binary files a/tests/httpcache/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 and /dev/null differ diff --git a/tests/httpcache/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f b/tests/httpcache/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f deleted file mode 100644 index 963596d..0000000 Binary files a/tests/httpcache/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f and /dev/null differ diff --git a/tests/httpcache/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b b/tests/httpcache/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b deleted file mode 100644 index 98f3401..0000000 Binary files a/tests/httpcache/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b and /dev/null differ diff --git a/tests/httpcache/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 b/tests/httpcache/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 deleted file mode 100644 index 88b6941..0000000 Binary files a/tests/httpcache/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 and /dev/null differ diff --git a/tests/httpcache/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a b/tests/httpcache/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a deleted file mode 100644 index 7e5e790..0000000 Binary files a/tests/httpcache/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a and /dev/null differ diff --git a/tests/httpcache/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 b/tests/httpcache/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 deleted file mode 100644 index aa3de52..0000000 Binary files a/tests/httpcache/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 and /dev/null differ diff --git a/tests/httpcache/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd b/tests/httpcache/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd deleted file mode 100644 index 6f72882..0000000 Binary files a/tests/httpcache/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd and /dev/null differ diff --git a/tests/httpcache/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 b/tests/httpcache/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 deleted file mode 100644 index 2f2e3c6..0000000 Binary files a/tests/httpcache/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 and /dev/null differ diff --git a/tests/httpcache/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 b/tests/httpcache/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 deleted file mode 100644 index 8ad4034..0000000 Binary files a/tests/httpcache/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 and /dev/null differ diff --git a/tests/httpcache/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 b/tests/httpcache/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 deleted file mode 100644 index e0ad340..0000000 Binary files a/tests/httpcache/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 and /dev/null differ diff --git a/tests/httpcache/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f b/tests/httpcache/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f deleted file mode 100644 index abb04bf..0000000 Binary files a/tests/httpcache/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f and /dev/null differ diff --git a/tests/httpcache/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 b/tests/httpcache/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 deleted file mode 100644 index 88383c2..0000000 Binary files a/tests/httpcache/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 and /dev/null differ diff --git a/tests/httpcache/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f b/tests/httpcache/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f deleted file mode 100644 index 0788a4d..0000000 Binary files a/tests/httpcache/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f and /dev/null differ diff --git a/tests/httpcache/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 b/tests/httpcache/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 deleted file mode 100644 index 896b4b8..0000000 Binary files a/tests/httpcache/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 and /dev/null differ diff --git a/tests/httpcache/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 b/tests/httpcache/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 deleted file mode 100644 index a183b43..0000000 Binary files a/tests/httpcache/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 and /dev/null differ diff --git a/tests/httpcache/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 b/tests/httpcache/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 deleted file mode 100644 index c1e558d..0000000 Binary files a/tests/httpcache/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 and /dev/null differ diff --git a/tests/httpcache/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 b/tests/httpcache/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 deleted file mode 100644 index e53b112..0000000 Binary files a/tests/httpcache/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 and /dev/null differ diff --git a/tests/httpcache/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 b/tests/httpcache/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 deleted file mode 100644 index b927d8e..0000000 Binary files a/tests/httpcache/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 and /dev/null differ diff --git a/tests/httpcache/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 b/tests/httpcache/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 deleted file mode 100644 index 1b85d54..0000000 Binary files a/tests/httpcache/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 and /dev/null differ diff --git a/tests/httpcache/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 b/tests/httpcache/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 deleted file mode 100644 index 91a56db..0000000 Binary files a/tests/httpcache/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 and /dev/null differ diff --git a/tests/httpcache/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 b/tests/httpcache/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 deleted file mode 100644 index 06e29c7..0000000 Binary files a/tests/httpcache/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 and /dev/null differ diff --git a/tests/httpcache/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 b/tests/httpcache/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 deleted file mode 100644 index 3c3ee3a..0000000 Binary files a/tests/httpcache/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 and /dev/null differ diff --git a/tests/httpcache/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc b/tests/httpcache/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc deleted file mode 100644 index 931541b..0000000 Binary files a/tests/httpcache/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc and /dev/null differ diff --git a/tests/httpcache/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 b/tests/httpcache/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 deleted file mode 100644 index 30b28f9..0000000 Binary files a/tests/httpcache/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 and /dev/null differ diff --git a/tests/httpcache/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 b/tests/httpcache/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 deleted file mode 100644 index 4dca791..0000000 Binary files a/tests/httpcache/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 and /dev/null differ diff --git a/tests/httpcache/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 b/tests/httpcache/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 deleted file mode 100644 index d976380..0000000 Binary files a/tests/httpcache/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 and /dev/null differ diff --git a/tests/httpcache/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 b/tests/httpcache/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 deleted file mode 100644 index 173b59d..0000000 Binary files a/tests/httpcache/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 and /dev/null differ diff --git a/tests/httpcache/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 b/tests/httpcache/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 deleted file mode 100644 index cf9df57..0000000 Binary files a/tests/httpcache/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 and /dev/null differ diff --git a/tests/httpcache/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 b/tests/httpcache/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 deleted file mode 100644 index 729e9eb..0000000 Binary files a/tests/httpcache/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 and /dev/null differ diff --git a/tests/httpcache/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 b/tests/httpcache/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 deleted file mode 100644 index 7879875..0000000 Binary files a/tests/httpcache/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 and /dev/null differ diff --git a/tests/httpcache/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf b/tests/httpcache/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf deleted file mode 100644 index 4e60a69..0000000 Binary files a/tests/httpcache/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf and /dev/null differ diff --git a/tests/httpcache/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 b/tests/httpcache/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 deleted file mode 100644 index 2d404b3..0000000 Binary files a/tests/httpcache/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 and /dev/null differ diff --git a/tests/httpcache/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c b/tests/httpcache/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c deleted file mode 100644 index 75fb260..0000000 Binary files a/tests/httpcache/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c and /dev/null differ diff --git a/tests/httpcache/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b b/tests/httpcache/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b deleted file mode 100644 index 7cdd0cc..0000000 Binary files a/tests/httpcache/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b and /dev/null differ diff --git a/tests/httpcache/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 b/tests/httpcache/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 deleted file mode 100644 index a92a26b..0000000 Binary files a/tests/httpcache/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 and /dev/null differ diff --git a/tests/httpcache/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 b/tests/httpcache/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 deleted file mode 100644 index d7d6426..0000000 Binary files a/tests/httpcache/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 and /dev/null differ diff --git a/tests/httpcache/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 b/tests/httpcache/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 deleted file mode 100644 index 9d7873d..0000000 Binary files a/tests/httpcache/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 and /dev/null differ diff --git a/tests/httpcache/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 b/tests/httpcache/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 deleted file mode 100644 index a5c00e2..0000000 Binary files a/tests/httpcache/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 and /dev/null differ diff --git a/tests/httpcache/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 b/tests/httpcache/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 deleted file mode 100644 index fffcaee..0000000 Binary files a/tests/httpcache/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 and /dev/null differ diff --git a/tests/httpcache/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd b/tests/httpcache/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd deleted file mode 100644 index 673a1a4..0000000 Binary files a/tests/httpcache/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd and /dev/null differ diff --git a/tests/httpcache/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d b/tests/httpcache/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d deleted file mode 100644 index 4cbed3c..0000000 Binary files a/tests/httpcache/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d and /dev/null differ diff --git a/tests/httpcache/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 b/tests/httpcache/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 deleted file mode 100644 index cdfe2dd..0000000 Binary files a/tests/httpcache/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 and /dev/null differ diff --git a/tests/httpcache/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b b/tests/httpcache/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b deleted file mode 100644 index 6c50eb5..0000000 Binary files a/tests/httpcache/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b and /dev/null differ diff --git a/tests/httpcache/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 b/tests/httpcache/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 deleted file mode 100644 index 56ba6a8..0000000 Binary files a/tests/httpcache/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 and /dev/null differ diff --git a/tests/httpcache/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 b/tests/httpcache/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 deleted file mode 100644 index 45f2bdf..0000000 Binary files a/tests/httpcache/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 and /dev/null differ diff --git a/tests/httpcache/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 b/tests/httpcache/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 deleted file mode 100644 index f6dff1b..0000000 Binary files a/tests/httpcache/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 and /dev/null differ diff --git a/tests/httpcache/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 b/tests/httpcache/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 deleted file mode 100644 index 19094c4..0000000 Binary files a/tests/httpcache/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 and /dev/null differ diff --git a/tests/httpcache/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 b/tests/httpcache/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 deleted file mode 100644 index 0b45a79..0000000 Binary files a/tests/httpcache/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 and /dev/null differ diff --git a/tests/httpcache/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a b/tests/httpcache/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a deleted file mode 100644 index 4c068e5..0000000 Binary files a/tests/httpcache/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a and /dev/null differ diff --git a/tests/httpcache/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 b/tests/httpcache/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 deleted file mode 100644 index aea699f..0000000 Binary files a/tests/httpcache/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 and /dev/null differ diff --git a/tests/httpcache/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd b/tests/httpcache/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd deleted file mode 100644 index 129120a..0000000 Binary files a/tests/httpcache/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd and /dev/null differ diff --git a/tests/httpcache/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 b/tests/httpcache/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 deleted file mode 100644 index 154e47f..0000000 Binary files a/tests/httpcache/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 and /dev/null differ diff --git a/tests/httpcache/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea b/tests/httpcache/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea deleted file mode 100644 index 05f8af2..0000000 Binary files a/tests/httpcache/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea and /dev/null differ diff --git a/tests/httpcache/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 b/tests/httpcache/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 deleted file mode 100644 index d3ba6dc..0000000 Binary files a/tests/httpcache/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 and /dev/null differ diff --git a/tests/httpcache/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 b/tests/httpcache/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 deleted file mode 100644 index 6f02fa8..0000000 Binary files a/tests/httpcache/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 and /dev/null differ diff --git a/tests/httpcache/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 b/tests/httpcache/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 deleted file mode 100644 index ea894c6..0000000 Binary files a/tests/httpcache/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 and /dev/null differ diff --git a/tests/httpcache/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 b/tests/httpcache/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 deleted file mode 100644 index 22dcdaa..0000000 Binary files a/tests/httpcache/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 and /dev/null differ diff --git a/tests/httpcache/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e b/tests/httpcache/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e deleted file mode 100644 index d7fbe98..0000000 Binary files a/tests/httpcache/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e and /dev/null differ diff --git a/tests/httpcache/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 b/tests/httpcache/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 deleted file mode 100644 index e011020..0000000 Binary files a/tests/httpcache/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 and /dev/null differ diff --git a/tests/httpcache/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c b/tests/httpcache/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c deleted file mode 100644 index 8917938..0000000 Binary files a/tests/httpcache/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c and /dev/null differ diff --git a/tests/httpcache/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 b/tests/httpcache/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 deleted file mode 100644 index 8823d89..0000000 Binary files a/tests/httpcache/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 and /dev/null differ diff --git a/tests/httpcache/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c b/tests/httpcache/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c deleted file mode 100644 index 916a273..0000000 Binary files a/tests/httpcache/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c and /dev/null differ diff --git a/tests/httpcache/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d b/tests/httpcache/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d deleted file mode 100644 index 7a7c06c..0000000 Binary files a/tests/httpcache/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d and /dev/null differ diff --git a/tests/httpcache/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 b/tests/httpcache/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 deleted file mode 100644 index e5c474c..0000000 Binary files a/tests/httpcache/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 and /dev/null differ diff --git a/tests/httpcache_py2/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 b/tests/httpcache_py2/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 deleted file mode 100644 index 88eb1ce..0000000 Binary files a/tests/httpcache_py2/07af40cf1941f2ad4d3bcc92cbc864be776f0398dac9e504692f8a499ff69854 and /dev/null differ diff --git a/tests/httpcache_py2/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 b/tests/httpcache_py2/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 deleted file mode 100644 index bf961db..0000000 Binary files a/tests/httpcache_py2/08b448975b0a5635d4c85e5b358c18d9e523e809e7a7b998789a138f9f10f264 and /dev/null differ diff --git a/tests/httpcache_py2/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 b/tests/httpcache_py2/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 deleted file mode 100644 index 55904ed..0000000 Binary files a/tests/httpcache_py2/0997572089f4e42247f2bb6b5de22c20f4efbd50ec4bb1a4c4e336057cd16892 and /dev/null differ diff --git a/tests/httpcache_py2/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 b/tests/httpcache_py2/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 deleted file mode 100644 index 4cb30c0..0000000 Binary files a/tests/httpcache_py2/120fc248dc0691db22506afd64bbf99d06ebf9be088f63347c330921808e3bf6 and /dev/null differ diff --git a/tests/httpcache_py2/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 b/tests/httpcache_py2/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 deleted file mode 100644 index 666cbc6..0000000 Binary files a/tests/httpcache_py2/19b1ca273ef7294dc13469f41e29683e8a4aabe96913c7269a711bafb31f72f1 and /dev/null differ diff --git a/tests/httpcache_py2/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f b/tests/httpcache_py2/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f deleted file mode 100644 index fbf85b6..0000000 Binary files a/tests/httpcache_py2/1a8316738ed28a9bbe32d269d9f6366a9633aa0516042b51eef62462f49aaf5f and /dev/null differ diff --git a/tests/httpcache_py2/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b b/tests/httpcache_py2/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b deleted file mode 100644 index 3c279af..0000000 Binary files a/tests/httpcache_py2/234bddbc9ea09e34c62c96557791c9bea194555b9670b46316d326a2dcb0a11b and /dev/null differ diff --git a/tests/httpcache_py2/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 b/tests/httpcache_py2/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 deleted file mode 100644 index 41baaf6..0000000 Binary files a/tests/httpcache_py2/26443651ad88ed46defce0f3a7f3a17ca4d5eeca0301786ec6313a8a8c3b2e00 and /dev/null differ diff --git a/tests/httpcache_py2/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a b/tests/httpcache_py2/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a deleted file mode 100644 index 65ebb96..0000000 Binary files a/tests/httpcache_py2/28b5e71822e2d336b82aa7ef932656e60eb465199160c6a87d26e37e3126bd2a and /dev/null differ diff --git a/tests/httpcache_py2/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 b/tests/httpcache_py2/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 deleted file mode 100644 index 340e7f4..0000000 Binary files a/tests/httpcache_py2/2c3d26638e042fcc68940b914a8506682a7c798c8e86414438dde46202130ba7 and /dev/null differ diff --git a/tests/httpcache_py2/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd b/tests/httpcache_py2/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd deleted file mode 100644 index a99af99..0000000 Binary files a/tests/httpcache_py2/33cd05d6ba0271f5fe6929d2e3663d0e6a055e07290cc7508e674dbfce6ed1dd and /dev/null differ diff --git a/tests/httpcache_py2/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 b/tests/httpcache_py2/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 deleted file mode 100644 index 3ceba21..0000000 Binary files a/tests/httpcache_py2/376f777caac26b557bfc81adf35b0e42d9df70fc98aae5bdbcba0b525cac5c52 and /dev/null differ diff --git a/tests/httpcache_py2/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 b/tests/httpcache_py2/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 deleted file mode 100644 index d4937b5..0000000 Binary files a/tests/httpcache_py2/3afb51c5a10cdc00db1f61a2560dcf8c688eaa84a843cf504aff22d7952378a4 and /dev/null differ diff --git a/tests/httpcache_py2/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 b/tests/httpcache_py2/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 deleted file mode 100644 index e55108f..0000000 Binary files a/tests/httpcache_py2/3b184ea30db8d17f065568dbb57e564212f5959916fe4d5cf172824de1553172 and /dev/null differ diff --git a/tests/httpcache_py2/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f b/tests/httpcache_py2/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f deleted file mode 100644 index c80fa55..0000000 Binary files a/tests/httpcache_py2/3dda1f269caf9c7ccfe5e0c7231101498cb2e7906421406dda361b91a644673f and /dev/null differ diff --git a/tests/httpcache_py2/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 b/tests/httpcache_py2/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 deleted file mode 100644 index 5653600..0000000 Binary files a/tests/httpcache_py2/409edd232e2c12ee61953fe3161938a21046926e27e5787065e1c24fc74817d6 and /dev/null differ diff --git a/tests/httpcache_py2/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f b/tests/httpcache_py2/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f deleted file mode 100644 index ac77d5a..0000000 Binary files a/tests/httpcache_py2/440167f3f49637d2c611f0d642d1f7fa7c3402580fdfabb72d5f4c4008ba7f2f and /dev/null differ diff --git a/tests/httpcache_py2/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 b/tests/httpcache_py2/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 deleted file mode 100644 index 460d838..0000000 Binary files a/tests/httpcache_py2/44e3b9348797967b2787b76b2b42c6455eaf5d0e6b8ceb3b19eee37def532054 and /dev/null differ diff --git a/tests/httpcache_py2/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 b/tests/httpcache_py2/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 deleted file mode 100644 index a89dc38..0000000 Binary files a/tests/httpcache_py2/45d6090db55365c3bdd68687567524b93169620435d719453dc2f61fb3105f91 and /dev/null differ diff --git a/tests/httpcache_py2/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 b/tests/httpcache_py2/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 deleted file mode 100644 index 680b5b5..0000000 Binary files a/tests/httpcache_py2/4780a4e991ff622b9bd5ae95b8c298028b4a36ce43c6d4878186cf7c24158a36 and /dev/null differ diff --git a/tests/httpcache_py2/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 b/tests/httpcache_py2/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 deleted file mode 100644 index 1f82380..0000000 Binary files a/tests/httpcache_py2/4c269d041e56b18baf5bb8e41fff9748d2bbf4683e58e7aadb186cef2a15c194 and /dev/null differ diff --git a/tests/httpcache_py2/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 b/tests/httpcache_py2/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 deleted file mode 100644 index 378cad7..0000000 Binary files a/tests/httpcache_py2/4d001018f1a474826c8c29b96608689bba4b72e8ff6a3584bcf30cba5e42b524 and /dev/null differ diff --git a/tests/httpcache_py2/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 b/tests/httpcache_py2/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 deleted file mode 100644 index cf0c12a..0000000 Binary files a/tests/httpcache_py2/4d2c98cc0c7eadc98a0bb5745c1dd501164714ca896eccc89f57b77f9ec24e19 and /dev/null differ diff --git a/tests/httpcache_py2/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 b/tests/httpcache_py2/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 deleted file mode 100644 index 1895cb7..0000000 Binary files a/tests/httpcache_py2/4f43f35247445e44cc2cd623b595da442ce9696a0cd6e40e1e857337935078a0 and /dev/null differ diff --git a/tests/httpcache_py2/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 b/tests/httpcache_py2/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 deleted file mode 100644 index ec53550..0000000 Binary files a/tests/httpcache_py2/4fed5d626a82be9f4a17e8a8c59b02714ebefa2819394d82350002f609185ac3 and /dev/null differ diff --git a/tests/httpcache_py2/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 b/tests/httpcache_py2/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 deleted file mode 100644 index 7d87139..0000000 Binary files a/tests/httpcache_py2/52910765baba4f1dc0cc0091110b65cb88218095b64426cbdbce92d60362b7d0 and /dev/null differ diff --git a/tests/httpcache_py2/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc b/tests/httpcache_py2/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc deleted file mode 100644 index b6a037c..0000000 --- a/tests/httpcache_py2/5a6d8f221f3c375f3b0fd8e89773a859fb4301dab5f53bc9d34d8e33bbc431dc +++ /dev/null @@ -1,588 +0,0 @@ -(ccopy_reg -_reconstructor -p1 -(crequests_cache.backends.base -_Store -p2 -c__builtin__ -object -p3 -NtRp4 -(dp5 -S'cookies' -p6 -g1 -(crequests.cookies -RequestsCookieJar -p7 -g3 -NtRp8 -(dp9 -S'_now' -p10 -I1593949737 -sS'_policy' -p11 -(icookielib -DefaultCookiePolicy -p12 -(dp13 -S'strict_rfc2965_unverifiable' -p14 -I01 -sS'strict_ns_domain' -p15 -I0 -sS'_allowed_domains' -p16 -NsS'rfc2109_as_netscape' -p17 -NsS'rfc2965' -p18 -I00 -sS'strict_domain' -p19 -I00 -sS'_now' -p20 -I1593949737 -sS'strict_ns_set_path' -p21 -I00 -sS'strict_ns_unverifiable' -p22 -I00 -sS'strict_ns_set_initial_dollar' -p23 -I00 -sS'hide_cookie2' -p24 -I00 -sS'_blocked_domains' -p25 -(tsS'netscape' -p26 -I01 -sbsS'_cookies' -p27 -(dp28 -sbsS'_content' -p29 -S'{"Error":"ID: 999999999999999999999999 not found"}' -p30 -sS'encoding' -p31 -S'utf-8' -p32 -sS'url' -p33 -Vhttps://api.thetvdb.com/series/999999999999999999999999 -p34 -sS'status_code' -p35 -I404 -sS'request' -p36 -g1 -(crequests.models -PreparedRequest -p37 -g3 -NtRp38 -(dp39 -S'body' -p40 -Nsg33 -S'https://api.thetvdb.com/series/999999999999999999999999' -p41 -sS'hooks' -p42 -(lp43 -sS'headers' -p44 -g1 -(crequests.structures -CaseInsensitiveDict -p45 -g3 -NtRp46 -(dp47 -S'_store' -p48 -ccollections -OrderedDict -p49 -((lp50 -(lp51 -S'connection' -p52 -a(S'Connection' -S'keep-alive' -tp53 -aa(lp54 -S'accept-encoding' -p55 -a(S'Accept-Encoding' -S'gzip, deflate' -tp56 -aa(lp57 -S'accept' -p58 -a(S'Accept' -S'application/json' -p59 -tp60 -aa(lp61 -S'user-agent' -p62 -a(S'User-Agent' -S'python-requests/2.24.0' -tp63 -aa(lp64 -S'accept-language' -p65 -a(S'Accept-Language' -S'en' -tp66 -aa(lp67 -S'content-type' -p68 -a(S'Content-Type' -g59 -tp69 -aa(lp70 -S'authorization' -p71 -a(S'Authorization' -VBearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTQ1NTQ1MzYsImlkIjoidHZkYl9hcGkgdGVzdHMiLCJvcmlnX2lhdCI6MTU5Mzk0OTczNn0.DuXR2ZLMlAJDkGt_AQNWg6Qc3A_5Dsl7Y4Lqwgb5Sgdn2jUW1Mh5KQdpAMLhYGkbTWOwPsU_e2HSXzrC0SaXZb7KBbvMLa3xpgzdjirXrnF9yY1lnQCI8zhwKC7XF-WvtfvaTVDV9cVp6IpK_DHAmYNosjJBwM5Fi3D9UePBoeNgtaxgiDhKcyOvpRYrzkLS3t0re_J288hRwBUaUhCVZQ-FnUV8ST_4fZbowOVAaaXYbZmNnkMgw9eHRW_mtMekH-jTHrP_a9mVUUOuOj-mE6_QVBbEsddZvshe4RGHoWlGk4aBxkJQuITNyNvw3gTR8EPvlo3b4NGf1BORUWgpXQ -tp72 -aatRp73 -sbsS'_body_position' -p74 -NsS'_cookies' -p75 -g1 -(g7 -g3 -NtRp76 -(dp77 -g10 -I1593949737 -sg11 -(icookielib -DefaultCookiePolicy -p78 -(dp79 -g14 -I01 -sg15 -I0 -sg16 -Nsg17 -Nsg18 -I00 -sg19 -I00 -sg20 -I1593949737 -sg21 -I00 -sg22 -I00 -sg23 -I00 -sg24 -I00 -sg25 -(tsg26 -I01 -sbsg27 -(dp80 -sbsS'method' -p81 -S'GET' -p82 -sbsg44 -g1 -(g45 -g3 -NtRp83 -(dp84 -g48 -g49 -((lp85 -(lp86 -S'content-type' -p87 -a(S'Content-Type' -p88 -S'application/json; charset=utf-8' -p89 -tp90 -aa(lp91 -S'content-length' -p92 -a(S'Content-Length' -p93 -S'66' -p94 -tp95 -aa(lp96 -S'connection' -p97 -a(S'Connection' -p98 -S'keep-alive' -p99 -tp100 -aa(lp101 -S'date' -p102 -a(S'Date' -p103 -S'Sun, 05 Jul 2020 11:48:57 GMT' -p104 -tp105 -aa(lp106 -S'cache-control' -p107 -a(S'Cache-Control' -p108 -S'private, max-age=86400' -p109 -tp110 -aa(lp111 -S'x-powered-by' -p112 -a(S'X-Powered-By' -p113 -S'Thundar!' -p114 -tp115 -aa(lp116 -S'x-thetvdb-api-version' -p117 -a(S'X-Thetvdb-Api-Version' -p118 -S'3.0.0' -p119 -tp120 -aa(lp121 -S'vary' -p122 -a(S'Vary' -p123 -S'Accept-Language' -p124 -tp125 -aa(lp126 -S'x-cache' -p127 -a(S'X-Cache' -p128 -S'Error from cloudfront' -p129 -tp130 -aa(lp131 -S'via' -p132 -a(S'Via' -p133 -S'1.1 53c50678e40ac01e17221f5619420630.cloudfront.net (CloudFront)' -p134 -tp135 -aa(lp136 -S'x-amz-cf-pop' -p137 -a(S'X-Amz-Cf-Pop' -p138 -S'PER50-C1' -p139 -tp140 -aa(lp141 -S'x-amz-cf-id' -p142 -a(S'X-Amz-Cf-Id' -p143 -S'fy5rlST7FqXcVpRw1TfrMvoXnEZtH0J6Tsdocl7fu2JL2_XDKGCT-g==' -p144 -tp145 -aatRp146 -sbsS'raw' -p147 -g1 -(crequests_cache.backends.base -_RawStore -p148 -g3 -NtRp149 -(dp150 -S'status' -p151 -I404 -sS'strict' -p152 -I01 -sg44 -g1 -(curllib3._collections -HTTPHeaderDict -p153 -g3 -NtRp154 -(dp155 -S'_container' -p156 -g49 -((lp157 -(lp158 -S'content-type' -p159 -a(lp160 -g88 -ag89 -aaa(lp161 -S'content-length' -p162 -a(lp163 -g93 -ag94 -aaa(lp164 -S'connection' -p165 -a(lp166 -g98 -ag99 -aaa(lp167 -S'date' -p168 -a(lp169 -g103 -ag104 -aaa(lp170 -S'cache-control' -p171 -a(lp172 -g108 -ag109 -aaa(lp173 -S'x-powered-by' -p174 -a(lp175 -g113 -ag114 -aaa(lp176 -S'x-thetvdb-api-version' -p177 -a(lp178 -g118 -ag119 -aaa(lp179 -S'vary' -p180 -a(lp181 -g123 -ag124 -aaa(lp182 -S'x-cache' -p183 -a(lp184 -g128 -ag129 -aaa(lp185 -S'via' -p186 -a(lp187 -g133 -ag134 -aaa(lp188 -S'x-amz-cf-pop' -p189 -a(lp190 -g138 -ag139 -aaa(lp191 -S'x-amz-cf-id' -p192 -a(lp193 -g143 -ag144 -aaatRp194 -sbsS'reason' -p195 -S'Not Found' -p196 -sS'version' -p197 -I11 -sS'_original_response' -p198 -(ihttplib -HTTPResponse -p199 -(dp200 -S'fp' -p201 -Nsg151 -I404 -sS'will_close' -p202 -I00 -sS'chunk_left' -p203 -S'UNKNOWN' -p204 -sS'length' -p205 -I0 -sg152 -I01 -sg195 -g196 -sg197 -I11 -sS'debuglevel' -p206 -I0 -sS'msg' -p207 -(ihttplib -HTTPMessage -p208 -(dp209 -g201 -Nsg151 -S'' -sS'startofbody' -p210 -NsS'startofheaders' -p211 -NsS'subtype' -p212 -S'json' -p213 -sS'type' -p214 -S'application/json' -p215 -sS'maintype' -p216 -S'application' -p217 -sg44 -(lp218 -S'Content-Type: application/json; charset=utf-8\r\n' -p219 -aS'Content-Length: 66\r\n' -p220 -aS'Connection: keep-alive\r\n' -p221 -aS'Date: Sun, 05 Jul 2020 11:48:57 GMT\r\n' -p222 -aS'Cache-Control: private, max-age=86400\r\n' -p223 -aS'X-Powered-By: Thundar!\r\n' -p224 -aS'X-Thetvdb-Api-Version: 3.0.0\r\n' -p225 -aS'Vary: Accept-Language\r\n' -p226 -aS'X-Cache: Error from cloudfront\r\n' -p227 -aS'Via: 1.1 53c50678e40ac01e17221f5619420630.cloudfront.net (CloudFront)\r\n' -p228 -aS'X-Amz-Cf-Pop: PER50-C1\r\n' -p229 -aS'X-Amz-Cf-Id: fy5rlST7FqXcVpRw1TfrMvoXnEZtH0J6Tsdocl7fu2JL2_XDKGCT-g==\r\n' -p230 -asS'dict' -p231 -(dp232 -S'x-amz-cf-pop' -p233 -S'PER50-C1' -p234 -sS'content-length' -p235 -S'66' -p236 -sS'via' -p237 -S'1.1 53c50678e40ac01e17221f5619420630.cloudfront.net (CloudFront)' -p238 -sS'x-cache' -p239 -S'Error from cloudfront' -p240 -sS'x-powered-by' -p241 -S'Thundar!' -p242 -sS'vary' -p243 -S'Accept-Language' -p244 -sS'x-thetvdb-api-version' -p245 -S'3.0.0' -p246 -sS'connection' -p247 -S'keep-alive' -p248 -sS'x-amz-cf-id' -p249 -S'fy5rlST7FqXcVpRw1TfrMvoXnEZtH0J6Tsdocl7fu2JL2_XDKGCT-g==' -p250 -sS'cache-control' -p251 -S'private, max-age=86400' -p252 -sS'date' -p253 -S'Sun, 05 Jul 2020 11:48:57 GMT' -p254 -sS'content-type' -p255 -S'application/json; charset=utf-8' -p256 -ssS'typeheader' -p257 -g256 -sS'encodingheader' -p258 -NsS'seekable' -p259 -I0 -sS'unixfrom' -p260 -S'' -sS'plisttext' -p261 -S'; charset=utf-8' -p262 -sS'plist' -p263 -(lp264 -S'charset=utf-8' -p265 -asbsS'chunked' -p266 -I0 -sS'_method' -p267 -g82 -sbsS'decode_content' -p268 -I00 -sbsg195 -g196 -sS'history' -p269 -(tsbcdatetime -datetime -p270 -(S'\x07\xe4\x07\x05\x0b09\n\xb3P' -tRp271 -tp272 -. \ No newline at end of file diff --git a/tests/httpcache_py2/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 b/tests/httpcache_py2/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 deleted file mode 100644 index c34fa9b..0000000 Binary files a/tests/httpcache_py2/5ba778581d38aa49351ab40941ba3ceddcd7f504c8b5475b72f5765bd4200a26 and /dev/null differ diff --git a/tests/httpcache_py2/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 b/tests/httpcache_py2/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 deleted file mode 100644 index 03b91b8..0000000 Binary files a/tests/httpcache_py2/6a6f4ff6442c50b20bad2fd73d65c6268d32b38220568a447321dc5b18fc8b72 and /dev/null differ diff --git a/tests/httpcache_py2/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 b/tests/httpcache_py2/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 deleted file mode 100644 index d3bc9df..0000000 Binary files a/tests/httpcache_py2/6bdf7786ddc74a1d8f6bdfa281d0bb35f6b9566395abcdcfd6dfd1fead20e885 and /dev/null differ diff --git a/tests/httpcache_py2/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 b/tests/httpcache_py2/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 deleted file mode 100644 index 01ef989..0000000 Binary files a/tests/httpcache_py2/6d4cf6ea06bdc7a7270bd1844ee0f173ebdf2ae3cff58783dc625d637ae94dc8 and /dev/null differ diff --git a/tests/httpcache_py2/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 b/tests/httpcache_py2/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 deleted file mode 100644 index 66ecb7e..0000000 Binary files a/tests/httpcache_py2/7db9ef6084de388ccd4c76d8667fc42847d6d858e2e017f8e6df0f310de39742 and /dev/null differ diff --git a/tests/httpcache_py2/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 b/tests/httpcache_py2/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 deleted file mode 100644 index 407f121..0000000 Binary files a/tests/httpcache_py2/7e5ab06171c96080e8ce8560a58ad2e7a7a8fc95b3093e33220087b44bb06d60 and /dev/null differ diff --git a/tests/httpcache_py2/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 b/tests/httpcache_py2/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 deleted file mode 100644 index 9c86230..0000000 Binary files a/tests/httpcache_py2/85b65f515e9e123877607048ad6e2782ecae85dd8abad14a0d75e5a5fffd6a55 and /dev/null differ diff --git a/tests/httpcache_py2/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf b/tests/httpcache_py2/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf deleted file mode 100644 index 955ab73..0000000 Binary files a/tests/httpcache_py2/89650088cebaae362bd35d3cc72a95b0a3ff73c2a4430e310ae837617c5720cf and /dev/null differ diff --git a/tests/httpcache_py2/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 b/tests/httpcache_py2/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 deleted file mode 100644 index f20b7f3..0000000 Binary files a/tests/httpcache_py2/91dd1fbdbeabb2ea39817fa18ccf165a59c365a3d98117c671b109986c38a9d7 and /dev/null differ diff --git a/tests/httpcache_py2/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c b/tests/httpcache_py2/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c deleted file mode 100644 index 57c984b..0000000 Binary files a/tests/httpcache_py2/923a0d0abc87170accbe9c71aa83d09585645f66cc9d27f5a1925adb0291115c and /dev/null differ diff --git a/tests/httpcache_py2/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b b/tests/httpcache_py2/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b deleted file mode 100644 index 67e2e24..0000000 Binary files a/tests/httpcache_py2/954dbfd278fe22fdbb9e6048f89724601e465e2c69c528d6dba08b37424c959b and /dev/null differ diff --git a/tests/httpcache_py2/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 b/tests/httpcache_py2/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 deleted file mode 100644 index 3c3b2d3..0000000 Binary files a/tests/httpcache_py2/9a5546aeedd514758fd504cfc646d4a9181cd4049e045ed299df296824a3c3d9 and /dev/null differ diff --git a/tests/httpcache_py2/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 b/tests/httpcache_py2/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 deleted file mode 100644 index be66351..0000000 Binary files a/tests/httpcache_py2/9c7acbc0aa92fd521af1fe3d72ba9d76ec2415c31f131a4313c1f330da994216 and /dev/null differ diff --git a/tests/httpcache_py2/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 b/tests/httpcache_py2/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 deleted file mode 100644 index 1f51a98..0000000 Binary files a/tests/httpcache_py2/9cb08f4cb7b3c44219931c1d5250da2f633a1cc573bfa5a4531e509ace26c766 and /dev/null differ diff --git a/tests/httpcache_py2/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 b/tests/httpcache_py2/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 deleted file mode 100644 index 80442e2..0000000 Binary files a/tests/httpcache_py2/9efad0ef561e1f8445b553c6e6f8e8769654c6eb7b779198d0b3a126df269a03 and /dev/null differ diff --git a/tests/httpcache_py2/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 b/tests/httpcache_py2/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 deleted file mode 100644 index 40d5600..0000000 Binary files a/tests/httpcache_py2/a28ac291f4761e05cd1be958a31d365100761ce3d86300bd2a854a92a57c9511 and /dev/null differ diff --git a/tests/httpcache_py2/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd b/tests/httpcache_py2/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd deleted file mode 100644 index aa3ab34..0000000 Binary files a/tests/httpcache_py2/a9a62262de0623d69a3145d8563f6dbc5d810aa821d32a78a8bb14c6eef7cedd and /dev/null differ diff --git a/tests/httpcache_py2/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d b/tests/httpcache_py2/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d deleted file mode 100644 index c7c1d9b..0000000 Binary files a/tests/httpcache_py2/b52d9259bbdc9edea35b3ca29d5bb4cf3bd33901fe3222449b005d6ad591173d and /dev/null differ diff --git a/tests/httpcache_py2/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 b/tests/httpcache_py2/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 deleted file mode 100644 index 31e9cac..0000000 Binary files a/tests/httpcache_py2/bd8fa3a1b728c133437cc0c7e0ac2161667d326630775e547e05922ba8bde745 and /dev/null differ diff --git a/tests/httpcache_py2/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b b/tests/httpcache_py2/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b deleted file mode 100644 index 9a5a422..0000000 Binary files a/tests/httpcache_py2/c25b8787e74c5f6d0ccc874ac79bd419cafb4e51f2ac6b5aee7e5ed906c8d65b and /dev/null differ diff --git a/tests/httpcache_py2/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 b/tests/httpcache_py2/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 deleted file mode 100644 index 2157217..0000000 Binary files a/tests/httpcache_py2/c69825366290adb9a56814216798578d9fd8d3c0676ed430ce60c20e7ee3a7c4 and /dev/null differ diff --git a/tests/httpcache_py2/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 b/tests/httpcache_py2/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 deleted file mode 100644 index 7c61669..0000000 Binary files a/tests/httpcache_py2/cda2efd6e84d746454fcc08d558ccf0349e84e0ca6d206a84b0d722f805f8088 and /dev/null differ diff --git a/tests/httpcache_py2/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 b/tests/httpcache_py2/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 deleted file mode 100644 index 07fe0e9..0000000 Binary files a/tests/httpcache_py2/cdc28d5a38ad2cd008e01f315a0dde695057f9565271f5afacacc0efebc770d7 and /dev/null differ diff --git a/tests/httpcache_py2/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 b/tests/httpcache_py2/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 deleted file mode 100644 index dd057f2..0000000 Binary files a/tests/httpcache_py2/ce8430a86549723e0980592c018013f71415858d54ac50e01d9d8308f8fecff3 and /dev/null differ diff --git a/tests/httpcache_py2/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 b/tests/httpcache_py2/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 deleted file mode 100644 index d6ef8b7..0000000 Binary files a/tests/httpcache_py2/cfecf585195efd0811de3ec8d389c7d3280cb6bc2bdcc82aed476a63a943d735 and /dev/null differ diff --git a/tests/httpcache_py2/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a b/tests/httpcache_py2/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a deleted file mode 100644 index 50bbaa8..0000000 Binary files a/tests/httpcache_py2/d5bc81d09b5367e75bbf157ccc4edcfd75712f9add2ef61a3181b602be44a10a and /dev/null differ diff --git a/tests/httpcache_py2/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 b/tests/httpcache_py2/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 deleted file mode 100644 index 5628c5b..0000000 Binary files a/tests/httpcache_py2/d701387e057c763069e41901de1a62a9457a34ed5511cc1771eec11c23fa9d96 and /dev/null differ diff --git a/tests/httpcache_py2/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd b/tests/httpcache_py2/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd deleted file mode 100644 index 68b9d2e..0000000 Binary files a/tests/httpcache_py2/d82967c274a0aa07e929f46b354df1d9cc3393d782980fc2f1fbfc9d47cfa7cd and /dev/null differ diff --git a/tests/httpcache_py2/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 b/tests/httpcache_py2/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 deleted file mode 100644 index 1f0004f..0000000 Binary files a/tests/httpcache_py2/e085517c970edb992793b75e7fb38fae8f8b7d27dfb3f3fdfe54e3505dc02948 and /dev/null differ diff --git a/tests/httpcache_py2/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea b/tests/httpcache_py2/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea deleted file mode 100644 index 0daccba..0000000 Binary files a/tests/httpcache_py2/e57e4ad48cae5aebb17daf7e1627444d94ef18817b9ff9977c08eb73006afbea and /dev/null differ diff --git a/tests/httpcache_py2/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 b/tests/httpcache_py2/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 deleted file mode 100644 index b7ba707..0000000 Binary files a/tests/httpcache_py2/e707a7b250a2b956afbd389bcef27656f02e864040742e6350b0a396ec8b7373 and /dev/null differ diff --git a/tests/httpcache_py2/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 b/tests/httpcache_py2/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 deleted file mode 100644 index f48fdc3..0000000 Binary files a/tests/httpcache_py2/e75741a2c491d5e7230487f235228bbef5c3078c2acddf140eb85c263d498714 and /dev/null differ diff --git a/tests/httpcache_py2/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 b/tests/httpcache_py2/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 deleted file mode 100644 index bae99da..0000000 Binary files a/tests/httpcache_py2/e77dda0ab8dab983730036979c189c494654d54f5dd69d139e62eff277348bd4 and /dev/null differ diff --git a/tests/httpcache_py2/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 b/tests/httpcache_py2/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 deleted file mode 100644 index 1570c81..0000000 Binary files a/tests/httpcache_py2/e94356f5c11edc5ec9a18cf6245b1fb7b6499e85da2b384fbba6bc491c84d791 and /dev/null differ diff --git a/tests/httpcache_py2/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e b/tests/httpcache_py2/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e deleted file mode 100644 index 67600ee..0000000 Binary files a/tests/httpcache_py2/ed66cf25e2fbba5595506d9f9eb10b52db7e469fd13b79752c0ce065678ee33e and /dev/null differ diff --git a/tests/httpcache_py2/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 b/tests/httpcache_py2/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 deleted file mode 100644 index 8088377..0000000 Binary files a/tests/httpcache_py2/f25022147290ac7decc62ea053da8d5ea5f4867edbb654cdf186f81c9b8dbc51 and /dev/null differ diff --git a/tests/httpcache_py2/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c b/tests/httpcache_py2/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c deleted file mode 100644 index 17c33b8..0000000 Binary files a/tests/httpcache_py2/f37fc6bb9f19241f31480f522e74aabcf49b31f0a4dfe796a79f53951591625c and /dev/null differ diff --git a/tests/httpcache_py2/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 b/tests/httpcache_py2/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 deleted file mode 100644 index c3b0271..0000000 Binary files a/tests/httpcache_py2/f38fc6c26761954b3c12ea0d4f9a7c29472efe2b7c5347b4d701fa4c3a39b761 and /dev/null differ diff --git a/tests/httpcache_py2/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c b/tests/httpcache_py2/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c deleted file mode 100644 index 11976a0..0000000 Binary files a/tests/httpcache_py2/f3e99227d7e57546da431572e6b92a491ee4fab646f58c7869e466006ab8ed0c and /dev/null differ diff --git a/tests/httpcache_py2/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d b/tests/httpcache_py2/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d deleted file mode 100644 index 2a317e5..0000000 Binary files a/tests/httpcache_py2/f53622b2ec8ff128a26fb13444fd43d5184929e99e9aee703c457e102102226d and /dev/null differ diff --git a/tests/httpcache_py2/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 b/tests/httpcache_py2/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 deleted file mode 100644 index ab1dcbb..0000000 Binary files a/tests/httpcache_py2/f5b84280fe0914746d26e57e7592ea4f516be3f3995f01ee9d9d73b647e721c5 and /dev/null differ diff --git a/tests/test_tvdb_api.py b/tests/test_tvdb_api.py index 2b3034f..0d768a0 100644 --- a/tests/test_tvdb_api.py +++ b/tests/test_tvdb_api.py @@ -11,26 +11,24 @@ import os import sys -import types import datetime +import unittest.mock + import pytest +import requests_cache.backends +import requests_cache.backends.base # Force parent directory onto path sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -import tvdb_api # noqa: E402 -from tvdb_api import ( # noqa: E402 - tvdb_shownotfound, - tvdb_seasonnotfound, - tvdb_episodenotfound, - tvdb_attributenotfound, +import tvdb_api +from tvdb_api import ( + TvdbShowNotFound, + TvdbSeasonNotFound, + TvdbEpisodeNotFound, + TvdbAttributeNotFound, ) - -import requests_cache.backends # noqa: E402 -import requests_cache.backends.base # noqa: E402 - - try: from collections.abc import MutableMapping except ImportError: @@ -97,28 +95,24 @@ def __str__(self): class FileCache(requests_cache.backends.base.BaseCache): - def __init__(self, _name, fc_base_dir, **options): + def __init__(self, fc_base_dir, **options): super(FileCache, self).__init__(**options) self.responses = FileCacheDict(base_dir=fc_base_dir) self.keys_map = FileCacheDict(base_dir=fc_base_dir) - -requests_cache.backends.registry['tvdb_api_file_cache'] = FileCache - - def get_test_cache_session(): here = os.path.dirname(os.path.abspath(__file__)) - additional = "_py2" if sys.version_info[0] == 2 else "" + cacher = requests_cache.FileCache( + cache_name=os.path.join(here, "http_cache"), + serializer='json', + ) sess = requests_cache.CachedSession( - backend="tvdb_api_file_cache", - fc_base_dir=os.path.join(here, "httpcache%s" % additional), include_get_headers=True, allowable_codes=(200, 404), + match_headers=['Accept-Language'], ) - sess.cache.create_key = types.MethodType(tvdb_api.create_key, sess.cache) return sess - class TestTvdbBasic: # Used to store the cached instance of Tvdb() t = None @@ -128,6 +122,20 @@ def setup_class(cls): if cls.t is None: cls.t = tvdb_api.Tvdb(cache=get_test_cache_session(), banners=False) + def test_class_setup(self): + """Checks class setup + """ + assert 1 == 1 + + def test_load_url_multi_page_system(self): + """Checks _load_url next page corruption system + Some series episodes list does not return the correct total of page + and next page in the links section. + The test should get the correct number of items from a knowed corrupted title + """ + episode_count = len(self.t._load_url('https://api.thetvdb.com/series/82931/episodes', data=None, language='en')) + assert episode_count == 200 + def test_different_case(self): """Checks the auto-correction of show names is working. It should correct the weirdly capitalised 'sCruBs' to 'Scrubs' @@ -166,7 +174,7 @@ def test_get_episode_overview(self): try: self.t['Scrubs']['something nonsensical'] - except tvdb_attributenotfound: + except TvdbAttributeNotFound: pass # good else: raise AssertionError("Expected attribute error") @@ -199,31 +207,31 @@ def setup_class(cls): def test_seasonnotfound(self): """Checks exception is thrown when season doesn't exist. """ - with pytest.raises(tvdb_seasonnotfound): + with pytest.raises(TvdbSeasonNotFound): self.t['Scrubs'][42] def test_shownotfound(self): """Checks exception is thrown when episode doesn't exist. """ - with pytest.raises(tvdb_shownotfound): + with pytest.raises(TvdbShowNotFound): self.t['the fake show thingy'] def test_shownotfound_by_id(self): """Checks exception is thrown when episode doesn't exist. """ - with pytest.raises(tvdb_shownotfound): + with pytest.raises(TvdbShowNotFound): self.t[999999999999999999999999] def test_episodenotfound(self): """Checks exception is raised for non-existent episode """ - with pytest.raises(tvdb_episodenotfound): + with pytest.raises(TvdbEpisodeNotFound): self.t['Scrubs'][1][30] def test_attributenamenotfound(self): """Checks exception is thrown for if an attribute isn't found. """ - with pytest.raises(tvdb_attributenotfound): + with pytest.raises(TvdbAttributeNotFound): self.t['Scrubs'][1][6]['afakeattributething'] self.t['Scrubs']['afakeattributething'] @@ -237,10 +245,16 @@ def setup_class(cls): if cls.t is None: cls.t = tvdb_api.Tvdb(cache=get_test_cache_session(), banners=False) - def test_search_len(self): - """There should be only one result matching + def test_search_standardize_serie(self): + """There should be one result matching + """ + assert len(self.t['Total Access 24/7'].search('Episode #13')) == 1 + + def test_search_url_encoding_serie(self): + """There should be one result matching """ - assert len(self.t['My Name Is Earl'].search('Faked My Own Death')) == 1 + assert len(self.t['Carnivàle'].search('The Day of the Dead')) == 1 + def test_search_checkname(self): """Checks you can get the episode name of a search result @@ -273,11 +287,11 @@ def test_aired_on(self): """Tests aired_on show method""" sr = self.t['Scrubs'].aired_on(datetime.date(2001, 10, 2)) assert len(sr) == 1 - assert sr[0]['episodeName'] == u'My First Day' + assert sr[0]['episodeName'] == 'My First Day' try: sr = self.t['Scrubs'].aired_on(datetime.date(1801, 1, 1)) - except tvdb_episodenotfound: + except TvdbEpisodeNotFound: pass # Good else: raise AssertionError("expected episode not found exception") @@ -311,7 +325,7 @@ def test_repr_show(self): """Check repr() of Season """ assert ( - repr(self.t['CNNNN']).replace("u'", "'") + repr(self.t['CNNNN']) == "" ) @@ -323,7 +337,7 @@ def test_repr_season(self): def test_repr_episode(self): """Check repr() of Episode """ - assert repr(self.t['CNNNN'][1][1]).replace("u'", "'") == "" + assert repr(self.t['CNNNN'][1][1]) == "" def test_available_langs(self): """Check available_languages returns something sane looking @@ -345,8 +359,8 @@ def test_episode_name_spanish(self): """Check episode data is in Spanish (language="es") """ t = tvdb_api.Tvdb(cache=get_test_cache_session(), language="es") - assert t['scrubs'][1][1]['episodeName'] == u'Mi primer día' - assert t['scrubs']['overview'].startswith(u'Scrubs es una divertida comedia') + assert t['scrubs'][1][1]['episodeName'] == 'Mi primer día' + assert t['scrubs']['overview'].startswith('Scrubs es una divertida comedia') def test_multilanguage_selection(self): """Check selected language is used @@ -363,18 +377,9 @@ def test_search_in_chinese(self): """Check searching for show with language=zh returns Chinese seriesname """ t = tvdb_api.Tvdb(cache=get_test_cache_session(), language="zh") - show = t[u'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i'] + show = t['T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i'] assert type(show) == tvdb_api.Show - assert show['seriesName'] == u'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i' - - @pytest.mark.skip('Новое API не возвращает сразу все языки') - def test_search_in_all_languages(self): - """Check search_all_languages returns Chinese show, with language=en - """ - t = tvdb_api.Tvdb(cache=get_test_cache_session(), search_all_languages=True, language="en") - show = t[u'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i'] - assert type(show) == tvdb_api.Show - assert show['seriesName'] == u'Virtues Of Harmony II' + assert show['seriesName'] == 'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i' class TestTvdbBanners: @@ -400,13 +405,11 @@ def test_banner_url(self): for bid, banner_info in res_data.items(): assert banner_info['_bannerpath'].startswith("http://") - @pytest.mark.skip('В новом API нет картинки у эпизода') def test_episode_image(self): """Checks episode 'filename' image is fully qualified URL """ assert self.t['scrubs'][1][1]['filename'].startswith("http://") - @pytest.mark.skip('В новом API у сериала кроме банера больше нет картинок') def test_show_artwork(self): """Checks various image URLs within season data are fully qualified """ @@ -451,7 +454,6 @@ class TestTvdbDoctest: def test_doctest(self): """Check docstring examples works""" import doctest - doctest.testmod(tvdb_api) @@ -479,7 +481,7 @@ def test_invalid_cache_option(self): def test_custom_request_session(self): from requests import Session as OriginalSession - class Used(Exception): + class Used(Exception): # noqa: N818 pass class CustomCacheForTest(OriginalSession): @@ -518,13 +520,13 @@ def test_ordering(self): t_dvd = tvdb_api.Tvdb(cache=get_test_cache_session(), dvdorder=True) t_air = tvdb_api.Tvdb(cache=get_test_cache_session()) - assert u'The Train Job' == t_air['Firefly'][1][1]['episodeName'] - assert u'Serenity' == t_dvd['Firefly'][1][1]['episodeName'] + assert 'The Train Job' == t_air['Firefly'][1][1]['episodeName'] + assert 'Serenity' == t_dvd['Firefly'][1][1]['episodeName'] assert ( - u'The Cat and the Claw (1)' == t_air['Batman The Animated Series'][1][1]['episodeName'] + 'The Cat and the Claw (1)' == t_air['Batman The Animated Series'][1][1]['episodeName'] ) - assert u'On Leather Wings' == t_dvd['Batman The Animated Series'][1][1]['episodeName'] + assert 'On Leather Wings' == t_dvd['Batman The Animated Series'][1][1]['episodeName'] class TestTvdbShowSearch: @@ -543,6 +545,56 @@ def test_search(self): all_ids = [x['id'] for x in results] assert 75397 in all_ids +def raise_error(e): + raise e + +class TestConsoleUI: + @unittest.mock.patch('builtins.input', lambda *args: '1') + def test_first_option(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI) + episode = t['scrubs'][1][2] + assert episode['episodeName'] == 'My Mentor' + + @unittest.mock.patch('builtins.input', lambda *args: '2') + def test_second_option(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI) + episode = t['scrubs'][1][2] + # Test second result is anything but the first option (not being specific to avoid sporadic test failures if results change order) + assert episode['episodeName'] != 'My Mentor' + + def test_select_first(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI, select_first=True) + episode = t['scrubs'][1][2] + assert episode['episodeName'] == 'My Mentor' + + @unittest.mock.patch('builtins.input', lambda *args: 'asdfasdf') + def test_first_option(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI) + episode = t['cnnnn'][1][2] + assert episode['episodeName'] == 'Terrorthon' + + @unittest.mock.patch('builtins.input', lambda *args: raise_error(KeyboardInterrupt("Stopit"))) + def test_select_interrupted(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI) + try: + episode = t['scrubs'][1][2] + except tvdb_api.TvdbUserAbort as e: + pass + else: + # Expected error + assert False + + @unittest.mock.patch('builtins.input', lambda *args: raise_error(EOFError())) + def test_select_error(self): + t = tvdb_api.Tvdb(cache=get_test_cache_session(), custom_ui=tvdb_api.ConsoleUI) + try: + episode = t['scrubs'][1][2] + except tvdb_api.TvdbUserAbort as e: + pass + else: + # Expected error + assert False + class TestTvdbAltNames: t = None @@ -561,9 +613,4 @@ def test_1(self): if __name__ == '__main__': - cache = get_test_cache_session() - t = tvdb_api.Tvdb(cache=cache) - t['scrubs'][1][2] - t = tvdb_api.Tvdb(cache=cache) - t['scrubs'][1][2] - # pytest.main() + pytest.main() diff --git a/tvdb_api.py b/tvdb_api.py index 624abd2..a5c48c4 100644 --- a/tvdb_api.py +++ b/tvdb_api.py @@ -11,51 +11,27 @@ >>> from tvdb_api import Tvdb >>> t = Tvdb() ->>> t['Lost'][4][11]['episodeName'] -u'Cabin Fever' +>>> t['Scrubs'][1][4]['episodeName'] +'The Hotel Inspectors' """ __author__ = "dbr/Ben" -__version__ = "3.1.0" +__author_rev__ = "doudalidou/jy" +__version__ = "3.2.0" import sys import os +import re import time -import types import getpass import tempfile -import warnings import logging -import hashlib +from urllib.parse import quote as url_quote import requests import requests_cache -_DEFAULT_HEADERS = requests.utils.default_headers() - -def _to_bytes(s, encoding='utf-8'): - return s if isinstance(s, bytes) else bytes(s, encoding) - - -IS_PY2 = sys.version_info[0] == 2 - -if IS_PY2: - user_input = raw_input # noqa - from urllib import quote as url_quote # noqa -else: - from urllib.parse import quote as url_quote - - user_input = input - - -if IS_PY2: - int_types = (int, long) # noqa - text_type = unicode # noqa -else: - int_types = int - text_type = str - LOG = logging.getLogger("tvdb_api") @@ -134,21 +110,6 @@ class TvdbAttributeNotFound(TvdbDataNotFound): pass - -# Backwards compatability re-bindings -tvdb_exception = TvdbBaseException # Deprecated, for backwards compatability -tvdb_error = TvdbError # Deprecated, for backwards compatability -tvdb_userabort = TvdbUserAbort # Deprecated, for backwards compatability -tvdb_notauthorized = TvdbNotAuthorized # Deprecated, for backwards compatability -tvdb_shownotfound = TvdbShowNotFound # Deprecated, for backwards compatability -tvdb_seasonnotfound = TvdbSeasonNotFound # Deprecated, for backwards compatability -tvdb_episodenotfound = TvdbEpisodeNotFound # Deprecated, for backwards compatability -tvdb_resourcenotfound = TvdbResourceNotFound # Deprecated, for backwards compatability -tvdb_attributenotfound = TvdbAttributeNotFound # Deprecated, for backwards compatability - -tvdb_invalidlanguage = TvdbError # Unused/removed. This exists for backwards compatability. - - # UI @@ -167,11 +128,11 @@ class BaseUI(object): contains the the keys "name" (human readable show name), and "sid" (the shows ID as on thetvdb.com). For example: - [{'name': u'Lost', 'sid': u'73739'}, - {'name': u'Lost Universe', 'sid': u'73181'}] + [{'name': 'Lost', 'sid': '73739'}, + {'name': 'Lost Universe', 'sid': '73181'}] The "selectSeries" method must return the appropriate dict, or it can raise - tvdb_userabort (if the selection is aborted), tvdb_shownotfound (if the show + TvdbUserAbort (if the selection is aborted), TvdbShowNotFound (if the show cannot be found). A simple example callback, which returns a random series: @@ -187,30 +148,28 @@ class BaseUI(object): >>> from tvdb_api import Tvdb >>> t = Tvdb(custom_ui = RandomUI) - >>> random_matching_series = t['Lost'] + >>> random_matching_series = t['Scrubs'] >>> type(random_matching_series) """ - def __init__(self, config, log=None): + def __init__(self, config): self.config = config - if log is not None: - warnings.warn( - "the UI's log parameter is deprecated, instead use\n" - "use import logging; logging.getLogger('ui').info('blah')\n" - "The self.log attribute will be removed in the next version" - ) - self.log = logging.getLogger(__name__) - def selectSeries(self, allSeries): - return allSeries[0] + def selectSeries(self, allSeries): # noqa: N802 # Deprecated + """Deprecated: use `select_series` method instead + """ + return self.select_series(all_series=allSeries) + + def select_series(self, all_series): + return all_series[0] class ConsoleUI(BaseUI): """Interactively allows the user to select a show from a console based UI """ - def _displaySeries(self, allSeries, limit=6): + def _display_series(self, allSeries, limit=6): """Helper function, lists series with corresponding ID """ if limit is not None: @@ -234,31 +193,34 @@ def _displaySeries(self, allSeries, limit=6): str(cshow['id']), extra, ) - if IS_PY2: - print(output.encode("UTF-8", "ignore")) - else: - print(output) + print(output) + + def selectSeries(self, allSeries): # noqa: N802 # Deprecated + """Deprecated: use `select_series` method instead + """ + + return self.select_series(all_series=allSeries) - def selectSeries(self, allSeries): - self._displaySeries(allSeries) + def select_series(self, all_series): # noqa: N802 # Deprecated + self._display_series(all_series) - if len(allSeries) == 1: + if len(all_series) == 1: # Single result, return it! print("Automatically selecting only result") - return allSeries[0] + return all_series[0] if self.config['select_first'] is True: print("Automatically returning first search result") - return allSeries[0] + return all_series[0] while True: # return breaks this loop try: print("Enter choice (first number, return for default, 'all', ? for help):") - ans = user_input() + ans = input() except KeyboardInterrupt: - raise tvdb_userabort("User aborted (^c keyboard interupt)") + raise TvdbUserAbort("User aborted (^c keyboard interupt)") except EOFError: - raise tvdb_userabort("User aborted (EOF received)") + raise TvdbUserAbort("User aborted (EOF received)") LOG.debug('Got choice of: %s' % (ans)) try: @@ -267,10 +229,10 @@ def selectSeries(self, allSeries): if len(ans.strip()) == 0: # Default option LOG.debug('Default option, returning first series') - return allSeries[0] + return all_series[0] if ans == "q": LOG.debug('Got quit command (q)') - raise tvdb_userabort("User aborted ('q' quit command)") + raise TvdbUserAbort("User aborted ('q' quit command)") elif ans == "?": print("## Help") print("# Enter the number that corresponds to the correct show.") @@ -280,17 +242,17 @@ def selectSeries(self, allSeries): print("# q - abort tvnamer") print("# Press return with no input to select first result") elif ans.lower() in ["a", "all"]: - self._displaySeries(allSeries, limit=None) + self._display_series(all_series, limit=None) else: LOG.debug('Unknown keypress %s' % (ans)) else: LOG.debug('Trying to return ID: %d' % (selected_id)) try: - return allSeries[selected_id] + return all_series[selected_id] except IndexError: LOG.debug('Invalid show number entered!') print("Invalid number (%s) selected!") - self._displaySeries(allSeries) + self._display_series(all_series) # Main API @@ -328,7 +290,7 @@ def __init__(self): def __repr__(self): return "" % ( - self.data.get(u'seriesName', 'instance'), + self.data.get('seriesName', 'instance'), len(self), ) @@ -344,16 +306,16 @@ def __getitem__(self, key): # Data wasn't found, raise appropriate error if isinstance(key, int) or key.isdigit(): # Episode number x was not found - raise tvdb_seasonnotfound("Could not find season %s" % (repr(key))) + raise TvdbSeasonNotFound("Could not find season %s" % (repr(key))) else: # If it's not numeric, it must be an attribute name, which # doesn't exist, so attribute error. - raise tvdb_attributenotfound("Cannot find attribute %s" % (repr(key))) + raise TvdbAttributeNotFound("Cannot find attribute %s" % (repr(key))) def aired_on(self, date): ret = self.search(str(date), 'firstAired') if len(ret) == 0: - raise tvdb_episodenotfound("Could not find any episodes that aired on %s" % date) + raise TvdbEpisodeNotFound("Could not find any episodes that aired on %s" % date) return ret def search(self, term=None, key=None): @@ -381,19 +343,19 @@ def search(self, term=None, key=None): containing "my first day": >>> t['Scrubs'].search("my first day") - [] + [] >>> Search for "My Name Is Earl" episode named "Faked His Own Death": >>> t['My Name Is Earl'].search('Faked My Own Death', key='episodeName') - [] + [] >>> To search Scrubs for all episodes with "mentor" in the episode name: >>> t['scrubs'].search('mentor', key='episodeName') - [, ] + [, ] >>> # Using search results @@ -427,7 +389,7 @@ def __repr__(self): def __getitem__(self, episode_number): if episode_number not in self: - raise tvdb_episodenotfound("Could not find episode %s" % (repr(episode_number))) + raise TvdbEpisodeNotFound("Could not find episode %s" % (repr(episode_number))) else: return dict.__getitem__(self, episode_number) @@ -437,7 +399,7 @@ def search(self, term=None, key=None): >>> t = Tvdb() >>> t['scrubs'][1].search('first day') - [] + [] >>> See Show.search documentation for further information on search @@ -457,9 +419,9 @@ def __init__(self, season=None): self.season = season def __repr__(self): - seasno = self.get(u'airedSeason', 0) - epno = self.get(u'airedEpisodeNumber', 0) - epname = self.get(u'episodeName') + seasno = self.get('airedSeason', 0) + epno = self.get('airedEpisodeNumber', 0) + epname = self.get('episodeName') if epname is not None: return "" % (seasno, epno, epname) else: @@ -469,7 +431,7 @@ def __getitem__(self, key): try: return dict.__getitem__(self, key) except KeyError: - raise tvdb_attributenotfound("Cannot find attribute %s" % (repr(key))) + raise TvdbAttributeNotFound("Cannot find attribute %s" % (repr(key))) def search(self, term=None, key=None): """Search episode data for term, if it matches, return the Episode (self). @@ -496,14 +458,14 @@ def search(self, term=None, key=None): if term is None: raise TypeError("must supply string to search for (contents)") - term = text_type(term).lower() + term = str(term).lower() for cur_key, cur_value in self.items(): - cur_key = text_type(cur_key) - cur_value = text_type(cur_value).lower() + cur_key = str(cur_key) + cur_value = str(cur_value).lower() if key is not None and cur_key != key: # Do not search this key continue - if cur_value.find(text_type(term)) > -1: + if cur_value.find(str(term)) > -1: return self @@ -528,46 +490,11 @@ def __repr__(self): return "" % self.get("name") -def create_key(self, request): - """A new cache_key algo is required as the authentication token - changes with each run. Also there are other header params which - also change with each request (e.g. timestamp). Excluding all - headers means that Accept-Language is excluded which means - different language requests will return the cached response from - the wrong language. - - The _loadurl part checks the cache before a get is performed so - that an auth token can be obtained. If the response is already in - the cache, the auth token is not required. This prevents the need - to do a get which may access the host and fail because the session - is not yet not authorized. It is not necessary to authorize if the - cache is to be used thus saving host and network traffic. - """ - - if self._ignored_parameters: - url, body = self._remove_ignored_parameters(request) - else: - url, body = request.url, request.body - key = hashlib.sha256() - key.update(_to_bytes(request.method.upper())) - key.update(_to_bytes(url)) - if request.body: - key.update(_to_bytes(body)) - else: - if self._include_get_headers and request.headers != _DEFAULT_HEADERS: - for name, value in sorted(request.headers.items()): - # include only Accept-Language as it is important for context - if name in ['Accept-Language']: - key.update(_to_bytes(name)) - key.update(_to_bytes(value)) - return key.hexdigest() - - class Tvdb: """Create easy-to-use interface to name of season/episode name >>> t = Tvdb() >>> t['Scrubs'][1][24]['episodeName'] - u'My Last Day' + 'My Last Day' """ def __init__( @@ -579,11 +506,9 @@ def __init__( actors=False, custom_ui=None, language=None, - search_all_languages=False, apikey=None, username=None, userkey=None, - forceConnect=None, # noqa dvdorder=False, ): @@ -611,7 +536,7 @@ def __init__( via the _banners key of a Show(), for example: >>> Tvdb(banners=True)['scrubs']['_banners'].keys() - [u'fanart', u'poster', u'seasonwide', u'season', u'series'] + ['fanart', 'poster', 'seasonwide', 'season', 'series'] actors (True/False): Retrieves a list of the actors for a show. These are accessed @@ -619,7 +544,7 @@ def __init__( >>> t = Tvdb(actors=True) >>> t['scrubs']['_actors'][0]['name'] - u'John C. McGinley' + 'John C. McGinley' custom_ui (tvdb_ui.BaseUI subclass): A callable subclass of tvdb_ui.BaseUI (overrides interactive option) @@ -630,11 +555,6 @@ def __init__( the `Tvdb.available_languages` method. Default is "en" (English). - search_all_languages (True/False): - By default, Tvdb will only search in the language specified using - the language option. When this is True, it will search for the - show in and language - apikey (str/unicode): Your API key for TheTVDB. You can easily register a key with in a few minutes: @@ -646,23 +566,14 @@ def __init__( userkey (str/unicode, or None): User authentication key relating to "username". - - forceConnect: - DEPRECATED. Disabled the timeout-throttling logic. Now has no function """ - if forceConnect is not None: - warnings.warn( - "forceConnect argument is deprecated and will be removed soon", - category=DeprecationWarning, - ) - self.shows = ShowContainer() # Holds all Show classes self.corrections = {} # Holds show-name to show_id mapping self.config = {} - # Ability to pull key form env-var mostly for unit-tests + # Ability to pull key from env-var mostly for unit-tests _test_key = os.getenv('TVDB_API_KEY') if apikey is None and _test_key is not None: apikey = _test_key @@ -686,12 +597,10 @@ def __init__( self.config['select_first'] = select_first - self.config['search_all_languages'] = search_all_languages - self.config['dvdorder'] = dvdorder if cache is True: - cache_dir = self._getTempDir() + cache_dir = self._get_temp_dir() LOG.debug("Caching using requests_cache to %s" % cache_dir) self.session = requests_cache.CachedSession( expire_after=21600, # 6 hours @@ -699,8 +608,7 @@ def __init__( cache_name=cache_dir, include_get_headers=True, ) - self.session.cache.create_key = types.MethodType(create_key, self.session.cache) - self.session.remove_expired_responses() + self.session.cache.delete(expired=True) self.config['cache_enabled'] = True elif cache is False: LOG.debug("Caching disabled") @@ -715,8 +623,7 @@ def __init__( cache_name=os.path.join(cache, "tvdb_api"), include_get_headers=True, ) - self.session.cache.create_key = types.MethodType(create_key, self.session.cache) - self.session.remove_expired_responses() + self.session.cache.delete(expired=True) else: LOG.debug("Using specified requests.Session") self.session = cache @@ -763,7 +670,7 @@ def __init__( 'Accept-Language': self.config['language'], } - def _getTempDir(self): + def _get_temp_dir(self): """Returns the [system temp dir]/tvdb_api-u501 (or tvdb_api-myuser) """ @@ -778,7 +685,13 @@ def _getTempDir(self): return os.path.join(tempfile.gettempdir(), "tvdb_api-%s-py%s" % (uid, py_major)) - def _loadUrl(self, url, data=None, recache=False, language=None): + def _standardize_serie_name(self, serie): + """Returns the serie name as alpha char and numerical only, + the other char are change to dash + """ + return re.sub('[^0-9a-zA-Z]+', '-', str(serie).lower()) + + def _load_url(self, url, data=None, language=None): """Return response from The TVDB API""" if not language: @@ -791,7 +704,7 @@ def _loadUrl(self, url, data=None, recache=False, language=None): # encoded url is used for hashing in the cache so # python 2 and 3 generate the same hash if not self.__authorized: - # only authorize of we haven't before and we + # only authorize if we haven't before and we # don't have the url in the cache fake_session_for_key = requests.Session() fake_session_for_key.headers['Accept-Language'] = language @@ -807,7 +720,7 @@ def _loadUrl(self, url, data=None, recache=False, language=None): # fmt: off # No fmt because mangles noqa comment - https://github.com/psf/black/issues/195 - if not cache_key or not self.session.cache.has_key(cache_key): # noqa: not a dict, has_key is part of requests-cache API + if not cache_key or not self.session.cache.contains(cache_key): # noqa: not a dict, contains is part of requests-cache API self.authorize() # fmt: on @@ -820,37 +733,47 @@ def _loadUrl(self, url, data=None, recache=False, language=None): errors = r.get('errors') r_data = r.get('data') links = r.get('links') + corrupted_links = False if error: - if error == u'Resource not found': - # raise(tvdb_resourcenotfound) + if error == 'Resource not found': + # raise(TvdbResourceNotFound) # handle no data at a different level so it is more specific pass - elif error.lower() == u'not authorized': + elif error.lower() == 'no results for your query: map[]': + # handle corrupted links page data and force last page and raise no error + corrupted_links = True + LOG.debug("found unexpected end of list, links section corrupted ?") + pass + elif error.lower() == 'not authorized': # Note: Error string sometimes comes back as "Not authorized" or "Not Authorized" - raise tvdb_notauthorized() + raise TvdbNotAuthorized() elif error.startswith(u"ID: ") and error.endswith("not found"): - # FIXME: Refactor error out of in this method - raise tvdb_shownotfound("%s" % error) + raise TvdbShowNotFound("%s" % error) else: - raise tvdb_error("%s" % error) + raise TvdbError("%s" % error) if errors: - if errors and u'invalidLanguage' in errors: - # raise(tvdb_invalidlanguage(errors[u'invalidLanguage'])) + if 'invalidLanguage' in errors: + # raise(TvdbError(errors['invalidLanguage'])) # invalidLanguage does not mean there is no data # there is just less data (missing translations) + LOG.debug("invalidLanguage, expecting less data (missing translations)") pass if data and isinstance(data, list): - data.extend(r_data) + if r_data is not None: + data.extend(r_data) else: data = r_data if links and links['next']: - url = url.split('?')[0] - _url = url + "?page=%s" % links['next'] - self._loadUrl(_url, data) + if corrupted_links: + LOG.debug("ending recursive data loading") + else: + url = url.split('?')[0] + _url = url + "?page=%s" % links['next'] + self._load_url(_url, data=data) return data @@ -862,27 +785,20 @@ def authorize(self): r_json = r.json() error = r_json.get('Error') if error: - if error == u'Not Authorized': - raise (tvdb_notauthorized) + if error == 'Not Authorized': + raise (TvdbNotAuthorized) token = r_json.get('token') - self.headers['Authorization'] = "Bearer %s" % text_type(token) + self.headers['Authorization'] = "Bearer %s" % str(token) self.__authorized = True - def _getetsrc(self, url, language=None): - """Loads a URL using caching, returns an ElementTree of the source - """ - src = self._loadUrl(url, language=language) - - return src - - def _setItem(self, sid, seas, ep, attrib, value): + def _set_item(self, sid, seas, ep, attrib, value): """Creates a new episode, creating Show(), Season() and Episode()s as required. Called by _getShowData to populate show Since the nice-to-use tvdb[1][24]['name] interface makes it impossible to do tvdb[1][24]['name] = "name" and still be capable of checking if an episode exists - so we can raise tvdb_shownotfound, we have a slightly + so we can raise TvdbShowNotFound, we have a slightly less pretty method of setting items.. but since the API is supposed to be read-only, this is the best way to do it! @@ -898,7 +814,7 @@ def _setItem(self, sid, seas, ep, attrib, value): self.shows[sid][seas][ep] = Episode(season=self.shows[sid][seas]) self.shows[sid][seas][ep][attrib] = value - def _setShowData(self, sid, key, value): + def _set_show_data(self, sid, key, value): """Sets self.shows[sid] to a new Show instance, or sets the data """ if sid not in self.shows: @@ -909,12 +825,18 @@ def search(self, series): """This searches TheTVDB.com for the series name and returns the result list """ - series = url_quote(series.encode("utf-8")) + serie_name = url_quote(series.encode("utf-8")) LOG.debug("Searching for show %s" % series) - series_resp = self._getetsrc(self.config['url_getSeries'] % (series)) + series_resp = self._load_url(self.config['url_getSeries'] % (serie_name)) + + if not series_resp: + LOG.debug("Series result returned zero with url encoding, trying with standardize serie name") + serie_name = self._standardize_serie_name(series) + series_resp = self._load_url(self.config['url_getSeries'] % (serie_name)) + if not series_resp: LOG.debug('Series result returned zero') - raise tvdb_shownotfound( + raise TvdbShowNotFound( "Show-name search returned zero results (cannot find show on TVDB)" ) @@ -926,7 +848,7 @@ def search(self, series): return all_series - def _getSeries(self, series): + def _get_series(self, series): """This searches TheTVDB.com for the series name, If a custom_ui UI is configured, it uses this to select the correct series. If not, and interactive == True, ConsoleUI is used, if not @@ -945,17 +867,17 @@ def _getSeries(self, series): LOG.debug('Interactively selecting show using ConsoleUI') ui = ConsoleUI(config=self.config) - return ui.selectSeries(all_series) + return ui.select_series(all_series) def available_languages(self): """Returns a list of the available language abbreviations which can be used in Tvdb(language="...") etc """ - et = self._getetsrc("https://api.thetvdb.com/languages") + et = self._load_url("https://api.thetvdb.com/languages") languages = [x['abbreviation'] for x in et] return sorted(languages) - def _parseBanners(self, sid): + def _parse_banners(self, sid): """Parses banners XML, from http://thetvdb.com/api/[APIKEY]/series/[SERIES ID]/banners.xml @@ -963,9 +885,9 @@ def _parseBanners(self, sid): >>> t = Tvdb(banners = True) >>> t['scrubs']['_banners'].keys() - [u'fanart', u'poster', u'seasonwide', u'season', u'series'] + ['fanart', 'poster', 'seasonwide', 'season', 'series'] >>> t['scrubs']['_banners']['poster']['680x1000'][35308]['_bannerpath'] - u'http://thetvdb.com/banners/posters/76156-2.jpg' + 'http://thetvdb.com/banners/posters/76156-2.jpg' >>> Any key starting with an underscore has been processed (not the raw @@ -974,10 +896,10 @@ def _parseBanners(self, sid): This interface will be improved in future versions. """ LOG.debug('Getting season banners for %s' % (sid)) - banners_resp = self._getetsrc(self.config['url_seriesBanner'] % sid) + banners_resp = self._load_url(self.config['url_seriesBanner'] % sid) banners = {} for cur_banner in banners_resp.keys(): - banners_info = self._getetsrc(self.config['url_seriesBannerInfo'] % (sid, cur_banner)) + banners_info = self._load_url(self.config['url_seriesBannerInfo'] % (sid, cur_banner)) for banner_info in banners_info: bid = banner_info.get('id') btype = banner_info.get('keyType') @@ -1004,9 +926,9 @@ def _parseBanners(self, sid): banners[btype][btype2][bid][new_key] = new_url banners[btype]['raw'] = banners_info - self._setShowData(sid, "_banners", banners) + self._set_show_data(sid, "_banners", banners) - def _parseActors(self, sid): + def _parse_actors(self, sid): """Parsers actors XML, from http://thetvdb.com/api/[APIKEY]/series/[SERIES ID]/actors.xml @@ -1019,20 +941,20 @@ def _parseActors(self, sid): >>> type(actors[0]) >>> actors[0] - + >>> sorted(actors[0].keys()) - [u'id', u'image', u'imageAdded', u'imageAuthor', u'lastUpdated', u'name', u'role', - u'seriesId', u'sortOrder'] + ['id', 'image', 'imageAdded', 'imageAuthor', 'lastUpdated', 'name', 'role', + 'seriesId', 'sortOrder'] >>> actors[0]['name'] - u'John C. McGinley' + 'John C. McGinley' >>> actors[0]['image'] - u'http://thetvdb.com/banners/actors/43638.jpg' + 'http://thetvdb.com/banners/actors/43638.jpg' Any key starting with an underscore has been processed (not the raw data from the XML) """ LOG.debug("Getting actors for %s" % (sid)) - actors_resp = self._getetsrc(self.config['url_actorsInfo'] % (sid)) + actors_resp = self._load_url(self.config['url_actorsInfo'] % (sid)) cur_actors = Actors() for cur_actor_item in actors_resp: @@ -1043,9 +965,9 @@ def _parseActors(self, sid): value = self.config['url_artworkPrefix'] % (value) cur_actor[tag] = value cur_actors.append(cur_actor) - self._setShowData(sid, '_actors', cur_actors) + self._set_show_data(sid, '_actors', cur_actors) - def _getShowData(self, sid, language): + def _get_show_data(self, sid, language): """Takes a series ID, gets the epInfo URL and parses the TVDB XML file into the shows dict in layout: shows[series_id][season_number][episode_number] @@ -1054,7 +976,7 @@ def _getShowData(self, sid, language): if self.config['language'] is None: LOG.debug('Config language is none, using show language') if language is None: - raise tvdb_error("config['language'] was None, this should not happen") + raise TvdbError("config['language'] was None, this should not happen") else: LOG.debug( 'Configured language %s override show language of %s' @@ -1063,30 +985,30 @@ def _getShowData(self, sid, language): # Parse show information LOG.debug('Getting all series data for %s' % (sid)) - series_info_resp = self._getetsrc(self.config['url_seriesInfo'] % sid) + series_info_resp = self._load_url(self.config['url_seriesInfo'] % sid) for tag, value in series_info_resp.items(): if value is not None: if tag in ['banner', 'fanart', 'poster']: value = self.config['url_artworkPrefix'] % (value) - self._setShowData(sid, tag, value) + self._set_show_data(sid, tag, value) # set language - self._setShowData(sid, u'language', self.config['language']) + self._set_show_data(sid, 'language', self.config['language']) # Parse banners if self.config['banners_enabled']: - self._parseBanners(sid) + self._parse_banners(sid) # Parse actors if self.config['actors_enabled']: - self._parseActors(sid) + self._parse_actors(sid) # Parse episode data LOG.debug('Getting all episodes of %s' % (sid)) url = self.config['url_epInfo'] % sid - eps_resp = self._getetsrc(url, language=language) + eps_resp = self._load_url(url, language=language) for cur_ep in eps_resp: @@ -1121,9 +1043,9 @@ def _getShowData(self, sid, language): if value is not None: if tag == 'filename': value = self.config['url_artworkPrefix'] % (value) - self._setItem(sid, seas_no, ep_no, tag, value) + self._set_item(sid, seas_no, ep_no, tag, value) - def _nameToSid(self, name): + def _name_to_sid(self, name): """Takes show name, returns the correct series ID (if the show has already been grabbed), or grabs all episodes and returns the correct SID. @@ -1133,12 +1055,12 @@ def _nameToSid(self, name): sid = self.corrections[name] else: LOG.debug('Getting show %s' % name) - selected_series = self._getSeries(name) + selected_series = self._get_series(name) sid = selected_series['id'] LOG.debug('Got %(seriesName)s, id %(id)s' % selected_series) self.corrections[name] = sid - self._getShowData(selected_series['id'], self.config['language']) + self._get_show_data(selected_series['id'], self.config['language']) return sid @@ -1146,14 +1068,14 @@ def __getitem__(self, key): """Handles tvdb_instance['seriesName'] calls. The dict index should be the show id """ - if isinstance(key, int_types): + if isinstance(key, int): sid = key else: - sid = self._nameToSid(key) + sid = self._name_to_sid(key) LOG.debug('Got series id %s' % sid) if sid not in self.shows: - self._getShowData(sid, self.config['language']) + self._get_show_data(sid, self.config['language']) return self.shows[sid] def __repr__(self): @@ -1169,8 +1091,8 @@ def main(): logging.basicConfig(level=logging.DEBUG) tvdb_instance = Tvdb(interactive=False, cache=False) - print(tvdb_instance['Lost']['seriesName']) - print(tvdb_instance['Lost'][1][4]['episodename']) + print(tvdb_instance['Scrubs']['seriesName']) + print(tvdb_instance['Scrubs'][1][4]['episodename']) if __name__ == '__main__':