Releases: jdepoix/youtube-transcript-api
Releases · jdepoix/youtube-transcript-api
v1.2.4
What's Changed
- When a
WebshareProxyConfigis created with a proxy username containing the "-rotate" suffix, the suffix will no longer be appended twice by @cjkangme in #566 - Fixed typo in README by @kiankyars in #551
New Contributors
- @kiankyars made their first contribution in #551
- @cjkangme made their first contribution in #566
Full Changelog: v1.2.3...v1.2.4
v1.2.3
v1.2.2
v1.2.1
What's Changed
- Added the property
filter_ip_locationstoWebshareProxyConfig. This allows for limiting the pool of IPs that Webshare will be rotating through to those located in specific countries. By choosing locations that are close to the machine that is doing the requests, latency can be reduced. Also, this can be used to work around location-based restrictions.The full list of available locations (and how many IPs are available in each location) can be found here.ytt_api = YouTubeTranscriptApi( proxy_config=WebshareProxyConfig( proxy_username="<proxy-username>", proxy_password="<proxy-password>", filter_ip_locations=["de", "us"], ) ) # Webshare will now only rotate through IPs located in Germany or the United States! ytt_api.fetch(video_id)
- [Fixes #483] Add
__all__to__init__.pyto support mypy --strict usage by @Jer-Pha in #486
New Contributors
Full Changelog: v1.2.0...v1.2.1
v1.2.0
What's Changed
- [BREAKING] Removed the deprecated methods
get_transcript,get_transcriptsandlist_transcripts. They have already been deprecated inv1.0.0, but I've kept them around to allow for an easier migration tov1.0.0. However, these methods have led to a lot of issues being created due to people initializing aYouTubeTranscriptApiobject and passing a proxy config into the constructor, but then calling the deprecated static methods on that object. As these methods are static they don't/can't access the state set in the constructor, therefore, the proxy config is ignored.
Migration Guide
If you're still using get_transcript, get_transcripts you have to change your code as follows:
# old API
transcript = YouTubeTranscriptApi.get_transcript("abc")
# new API
ytt_api = YouTubeTranscriptApi()
transcript = ytt_api.fetch("abc").to_raw_data()If you're still using list_transcripts you have to change your code as follows:
# old API
transcript_list = YouTubeTranscriptApi.list_transcripts("abc")
# new API
ytt_api = YouTubeTranscriptApi()
transcript_list = ytt_api.list("abc")Full Changelog: v1.1.1...v1.2.0
v1.1.1
v1.1.0
What's Changed
- Refactored the way the captions json is retrieved from scraping it from the
/watchhtml to fetching it from the innertube API - Added a new exception called
PoTokenRequired, which will be raised iftimedtexturls are encountered that require a PO token, such that we get feedback from users ASAP if this happens again
Breaking
- Unfortunately, I haven't been able to implement authentication for the innertube API yet. As I wanted to provide a fix for this issue ASAP, I decided to disable cookie authentication for the time being.
Full Changelog: v1.0.3...v1.1.0
v1.0.3
What's Changed
- Refactored parsing of the JS var containing the transcript data, to make it more robust to changes in the formatting of the returned HTML
Full Changelog: v1.0.2...v1.0.3
v1.0.2
What's Changed
- Added retry mechanism, which will retry requests when Webshare proxies are used and
RequestBlockedis raised, to trigger an IP rotation in case a user encounters a blocked residential IP - Added new error messages when
RequestBlockedis raised despite proxies being used, to assist users in figuring out what the issue is - Fixed PEP-8 warning by @afourney in #396
New Contributors
Full Changelog: v1.0.1...v1.0.2
v1.0.1
What's Changed
- Adds a feature to allow proxy configs to prevent the HTTP client from keeping TCP connections open, as keeping TCP connections alive can prevent proxy providers from rotating your IP
- adds the
prevent_keeping_connections_alive() -> boolmethod toProxyConfigobjects - When initializing YouTubeTranscriptApi a
Connection: closeheader will be added to the HTTP client, if a proxy config withprevent_keeping_connections_alive() == Trueis used
- adds the
- Added py.typed by @jkawamoto in #390
New Contributors
- @jkawamoto made their first contribution in #390
Full Changelog: v1.0.0...v1.0.1