commit
d9c11facfb
|
@ -0,0 +1,49 @@
|
|||
pip-run: &pip-install
|
||||
name: Install Python dependencies
|
||||
command: |
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install pytest
|
||||
pip install -e .[cloudflare]
|
||||
|
||||
|
||||
version: 2
|
||||
jobs:
|
||||
nineanime:
|
||||
docker:
|
||||
- image: circleci/python:3.6
|
||||
steps:
|
||||
- checkout
|
||||
- run: *pip-install
|
||||
- run: venv/bin/python -m pytest tests/test_anime.py --anime-url https://www4.9anime.is/watch/kochinpa.p6l6/j6ooy2
|
||||
kissanime:
|
||||
docker:
|
||||
- image: circleci/python:3.6
|
||||
steps:
|
||||
- checkout
|
||||
- run: *pip-install
|
||||
- run: venv/bin/python -m pytest tests/test_anime.py --anime-url http://kissanime.ru/Anime/Kochin-Pa
|
||||
gogoanime:
|
||||
docker:
|
||||
- image: circleci/python:3.6
|
||||
steps:
|
||||
- checkout
|
||||
- run: *pip-install
|
||||
- run: venv/bin/python -m pytest tests/test_anime.py --anime-url https://www2.gogoanime.se/category/kochin-pa-
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
nightly:
|
||||
jobs:
|
||||
- nineanime
|
||||
- gogoanime
|
||||
# Kissanime will always fail on remote servers due to cloudflare
|
||||
# - kissanime
|
||||
|
||||
triggers:
|
||||
- schedule:
|
||||
cron: "0 0 * * *"
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
|
@ -22,6 +22,8 @@ Yeah. Me too! That's why this tool exists.
|
|||
|
||||
## Supported Sites
|
||||
|
||||
[![CircleCI](https://circleci.com/gh/vn-ki/anime-downloader/tree/master.svg?style=svg)](https://circleci.com/gh/vn-ki/anime-downloader/tree/master)
|
||||
|
||||
- 9anime
|
||||
- KissAnime [cloudflare]
|
||||
- KissCartoon [cloudflare]
|
||||
|
|
6
setup.py
6
setup.py
|
@ -2,11 +2,12 @@
|
|||
|
||||
from setuptools import setup, find_packages
|
||||
import re
|
||||
import io
|
||||
|
||||
with open('README.md', 'r') as f:
|
||||
long_description = f.read()
|
||||
|
||||
with open('anime_downloader/__version__.py', 'rt', encoding='utf8') as f:
|
||||
with io.open('anime_downloader/__version__.py', 'rt', encoding='utf8') as f:
|
||||
version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
|
||||
|
||||
|
||||
|
@ -25,6 +26,9 @@ setup(
|
|||
'Click>=6.7',
|
||||
'fuzzywuzzy>=0.16.0',
|
||||
],
|
||||
tests_require=[
|
||||
'pytest',
|
||||
],
|
||||
extras_require={
|
||||
'cloudflare': ['cfscrape>=1.9.5']
|
||||
},
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import pytest
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
'--anime-url',
|
||||
action='store',
|
||||
default='https://www4.9anime.is/watch/kochinpa.p6l6/j6ooy2',
|
||||
help='URL for (kochinpa!) anime for a specific site'
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def anime_url(request):
|
||||
return request.config.getoption('--anime-url')
|
|
@ -1,13 +1,15 @@
|
|||
from anime_downloader import get_anime_class
|
||||
from anime_downloader.sites.nineanime import NineAnime
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def anime():
|
||||
return NineAnime(
|
||||
'https://www4.9anime.is/watch/kochinpa.p6l6/j6ooy2',
|
||||
quality='360p'
|
||||
def anime(anime_url):
|
||||
cls = get_anime_class(anime_url)
|
||||
|
||||
return cls(
|
||||
anime_url, quality='360p'
|
||||
)
|
||||
|
||||
|
||||
|
@ -16,14 +18,11 @@ def test_length(anime):
|
|||
|
||||
|
||||
def test_title(anime):
|
||||
assert anime.title.lower() == 'kochinpa!'
|
||||
assert anime.title.lower() in ['kochinpa!', 'kochin pa!']
|
||||
|
||||
|
||||
def test_episode(anime):
|
||||
episode1 = anime[0]
|
||||
|
||||
assert episode1.title.lower(
|
||||
) == 'tw caffeine chihiro chyuu cthuko ctss damedesuyo dmo eraser evetaku first fff flax hatsuyuki hiryuu kaylith kaitou notsentai p saenaisubs scribbles tsundere watashi yolo kochinpa 01.e.mp4'
|
||||
assert episode1.stream_url.endswith('.mp4')
|
||||
|
||||
|
Loading…
Reference in New Issue