diff --git a/.travis.yml b/.travis.yml index 721f970..10deb0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,10 @@ language: python python: - "2.7" - - "3.4" - "3.5" - "3.6" -matrix: - include: - - python: 3.7 - dist: xenial - sudo: true + - "3.7" + - "3.8" install: - pip install -r requirements.txt script: diff --git a/README.md b/README.md index d2f3e60..6c2735a 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ YouTubeTranscriptApi.get_transcripts(video_ids, languages=['de', 'en']) If you want to list all transcripts which are available for a given video you can call: ```python -transcript_list = YouTubeTranscriptApi.list_transcripts(video_id, languages=['de', 'en']) +transcript_list = YouTubeTranscriptApi.list_transcripts(video_id) ``` This will return a `TranscriptList` object which is iterable and provides methods to filter the list of transcripts for specific languages and types, like: diff --git a/requirements.txt b/requirements.txt index f9ad916..0b8ea35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -requests +requests==2.24.0 # testing -mock -httpretty -coverage -coveralls \ No newline at end of file +mock==3.0.5 +httpretty==0.9.7 +coverage==5.2.1 +coveralls==1.11.1 diff --git a/setup.py b/setup.py index 1490707..9ab3e33 100644 --- a/setup.py +++ b/setup.py @@ -34,8 +34,11 @@ setuptools.setup( url="https://github.com/jdepoix/youtube-transcript-api", packages=setuptools.find_packages(), classifiers=( - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", + "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", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ), diff --git a/youtube_transcript_api/_api.py b/youtube_transcript_api/_api.py index 389cf31..e647041 100644 --- a/youtube_transcript_api/_api.py +++ b/youtube_transcript_api/_api.py @@ -1,8 +1,8 @@ import requests -try: +try: # pragma: no cover import http.cookiejar as cookiejar CookieLoadError = (FileNotFoundError, cookiejar.LoadError) -except ImportError: +except ImportError: # pragma: no cover import cookielib as cookiejar CookieLoadError = IOError diff --git a/youtube_transcript_api/test/test_api.py b/youtube_transcript_api/test/test_api.py index a081711..5f95451 100644 --- a/youtube_transcript_api/test/test_api.py +++ b/youtube_transcript_api/test/test_api.py @@ -21,8 +21,11 @@ from youtube_transcript_api import ( def load_asset(filename): - with open('{dirname}/assets/{filename}'.format(dirname=os.path.dirname(__file__), filename=filename)) as file: - return file.read() + filepath = '{dirname}/assets/{filename}'.format( + dirname=os.path.dirname(__file__), filename=filename) + + with open(filepath, mode="rb") as file: + return file.read().decode('utf-8') class TestYouTubeTranscriptApi(TestCase):