Commit Graph

286 Commits

Author SHA1 Message Date
Your Name dbf5eeafe6 Error message more descriptive 2021-01-22 14:18:56 +01:00
Your Name fb819c06e4 Fix test case name 2021-01-21 19:53:06 +01:00
Your Name 14c70359ba Fix "video not available" being shown to the user when when YouTube start asking for captcha resolution due to receiving too many requests from the same IP. Show instead an appropiate message.
To be able to keep making requests, the captcha must be solved in a browser and the browser cookie must be passed to youtube-transcript-api.
2021-01-21 19:43:29 +01:00
jdepoix 361986e221
Merge pull request #88 from jdepoix/feature/ISSUE-87
migrated to travis-ci.com
2020-10-20 11:08:14 +02:00
Jonas Depoix 2cd2e4b9ac Merge branch 'master' into feature/ISSUE-87 2020-10-20 11:00:18 +02:00
Jonas Depoix cd3dd0157f migrated to travis-ci.com 2020-10-20 10:53:50 +02:00
Chris Howell 138643a682 Merge branch 'master' into feature/ISSUE-23 2020-10-10 21:13:51 -07:00
jdepoix 8d1244f430
Merge pull request #84 from crhowell/bugfix/ISSUE-83
Bugfix/Issue 83 UnicodeDecodeError for Windows
2020-10-09 09:46:00 +02:00
Chris Howell 150c50cabe Fix since Python2.7 doesnt support encoding kwarg to open() 2020-10-08 14:29:26 -07:00
Chris Howell eb01e08b04 Add explicit utf-8 encoding for file I/O in test_api.py 2020-10-08 13:36:33 -07:00
Chris Howell d3cd5d1254 Add docs for formatters 2020-09-01 15:23:48 -07:00
Chris Howell 36f29c3058 Add a few initial test cases, could use more 2020-09-01 15:23:04 -07:00
Chris Howell f3dc6f508f Add new formatters.py module 2020-09-01 15:21:47 -07:00
Chris Howell 7a47fc83ad Merge branch 'master' of https://github.com/jdepoix/youtube-transcript-api 2020-09-01 14:26:14 -07:00
jdepoix 77e8137769
Merge pull request #76 from jdepoix/pin-dependency-versions
dependencies pinned
2020-08-31 15:24:06 +02:00
Jonas Depoix bc2a90bef7 removed version dependent import from coverage 2020-08-31 14:07:35 +02:00
Jonas Depoix b27510496c added python 3.8 support; dropped python 3.4 support due to build failure with new requests version 2020-08-31 13:43:19 +02:00
Jonas Depoix 8bab30a770 changed versions to python 2 supporting dependencies 2020-08-31 13:36:12 +02:00
Jonas Depoix 02b1940250 dependencies pinned 2020-08-31 13:29:03 +02:00
jdepoix b90326955a
Merge pull request #72 from dafiulh/patch-1
fix typo in documentation
2020-08-25 09:12:19 +02:00
Dafiul Haq 65659fd6ea
fix typo 2020-08-25 06:14:07 +07:00
Chris Howell 1e9b2c7727 Revert "Add formatters module"
Reverting again, apparently I had a misunderstanding of how to revert. Trying again.
This reverts commit dca4021dd7.
2020-08-21 12:21:12 -07:00
Chris Howell d75ad8c402 Revert "v0.3.1"
This reverts commit dec09fa48a.
2020-08-21 11:46:07 -07:00
Chris Howell 216abbe023 Add unittests for formatters.py 2020-07-09 20:14:36 -07:00
Chris Howell c4b8b5b18d formatters.py python 2 compliant and misc.
Remove use of ABC, not part of Python 2 and implementing ABCMeta changes between Python 2 and 3 so left it out entirely. Base class now raises NotImplementedError manually.

Fix parse_timecode issue with start and end times being identical

Replaced uses of F-strings with .format() also for compatibility.
2020-07-09 20:13:58 -07:00
Chris Howell 74d36a821e Update CLI to make use of new DELIMITER and combine method 2020-07-09 00:06:36 -07:00
Chris Howell 5861bdb104 Remove json.dumps from test_api.py
Remove unnecessary changes to tests, revert assertions back to how they were.

Remove unnecessary join from formatter in `_api.py`
2020-07-09 00:06:14 -07:00
Chris Howell 1c0d584959 Add more functionality to TranscriptFormatter base class
Due to the behavior of the CLI and API, needed more flexibility for combining 1 or many transcripts for a given formatter.

- Now can specify a DELIMITER to separate multiple transcripts on.
- Can also specify how those items are combine overriding the combine class method.

Remove unused imports
Fix adjust some lines to meet PEP
2020-07-09 00:04:08 -07:00
Chris Howell 2c79bd563c Fix _api.py old kwarg 2020-07-08 15:25:32 -07:00
Chris Howell c78a37b115 Update _cli.py
Add formats factory instance that uses the `parsed_args.format` arg to retrieve the formatter class, defaults to JSON if not passed or if given a bad/mistyped name.

Might consider error in the case of a bad name given. Shouldn't be too difficult to add that ability if its wanted.
2020-07-08 15:23:10 -07:00
Chris Howell b4592043dc Add format kwarg to method calls to pass around
Add format kwarg that defaults to None which still gets interpreted to use JSON when its not passed. This kwarg was given to `.get_transcripts()` and `.get_transcript()` since one relies on the other therefore can forward the kwarg.
2020-07-08 15:20:47 -07:00
Chris Howell 0e6fae2504 replace CLI json arg with format in test_cli.py
Replaced every occurance of `parsed_args.json` with `parsed_args.format` as well as the CLI arguments to match for testing.
2020-07-08 15:14:32 -07:00
Chris Howell ac75f906e6 Update test_api.py
Fixed an encoding issue for Windows machines receiving an error due to Lines 24-27:
`UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 119434: character maps to <undefined>`.

Adjusted test_api.py to fix an issue when the format=None isnt passed with mock test raising:
`AssertionError: get_transcript('video_id_1', ['de', 'en'], None, None) call not found`

Added `import json` to convert test data for json data into a string for 1 or many json transcripts to keep in line with how the formatters are eventually returned as strings.
2020-07-08 15:11:54 -07:00
Chris Howell dca4021dd7 Add formatters module
Add formatters module that contains a few basic built-in formatters for JSON, SRT, and an arbitrary plain TEXT. Mainly for examples of implementing your own.

Module contains an abstract base class `TranscriptFormatter` so that anyone can create their own TranscriptFormatter class

Module contains at runtime a `formats` which is basically an instance of a factory of classes (not sure if that is the correct term to use). But it itself is an instance that folks can add custom formatter classes that the API can make use of.
2020-07-08 15:05:17 -07:00
Jonas Depoix dec09fa48a v0.3.1 2020-02-16 14:22:59 +01:00
Jonas Depoix 6751a47171 fixed typo in README 2020-02-16 14:04:53 +01:00
Jonas Depoix 21de9d606a v0.3.0 2020-01-31 11:31:21 +01:00
jdepoix 6da4d19978
Merge pull request #46 from danielcliu/feature/issue-45-use-authentication-cookies
Feature/issue 45 use authentication cookies
2020-01-31 11:29:25 +01:00
Jonas Depoix a0823ea36f added documentation for using cookies feature via CLI to the README 2020-01-31 11:26:39 +01:00
danielcliu 31b8f4a179 Redid errors for cookies, improved testing coverage 2020-01-30 21:53:18 -08:00
danielcliu 49ccba7f95 Fixed testing with mock, added testing for cookies 2020-01-27 21:47:04 -08:00
danielcliu 42d4f59e01 Moved cookie loader to its own function, made errors for cookies failing 2020-01-27 21:46:37 -08:00
danielcliu 67604ec46c Made testing more robust 2020-01-22 22:35:35 -08:00
danielcliu f9e553ebaf Added cli support, fixed testing 2020-01-20 23:04:46 -08:00
danielcliu dc9fc2ee93 Updated Readme to include how to use cookies with the module 2020-01-15 22:48:26 -08:00
danielcliu 02b1978217 Added cookies parameter to api class methods 2020-01-15 22:48:00 -08:00
danielcliu edefeeaf1d
Merge pull request #1 from jdepoix/master
Updating to current master
2020-01-09 18:56:45 -08:00
Jonas Depoix 7dfe20fde4 v0.2.1 2019-12-31 00:13:13 +01:00
jdepoix bfecd64b85
Merge pull request #43 from jdepoix/bugfix/cli-language-default
fixed bug in cli where no transcript could be retrieved if no language was specified
2019-12-31 00:12:39 +01:00
Jonas Depoix 7159f60823 fixed bug in cli where no transcript could be retrieved if no language was specified 2019-12-31 00:11:52 +01:00