Tools to translate your content. Add your own translations. Add translated video titles and descriptions to your videos. Viewers can discover your videos in their own language. We'll show the title and description of the video in the right language, to the right viewers. To reach a larger audience, add your own subtitles and closed captions. Don’t be afraid to get into the nitty-gritty details here. In fact, I recommend writing AT LEAST 150 words. And make sure to use keywords that you want your video to rank for. That way, YouTube can fully understand your video content. For example, check out this description from one of my videos.
Latest versionReleased:
This is an python API which allows you to get the transcripts/subtitles for a given YouTube video. It also works for automatically generated subtitles, supports translating subtitles and it does not require a headless browser, like other selenium based solutions do!
Project description
This is a python API which allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles, supports translating subtitles and it does not require a headless browser, like other selenium based solutions do!
Install
It is recommended to install this module by using pip:
If you want to use it from source, you'll have to install the dependencies manually:
You can either integrate this module into an existing application, or just use it via an CLI.
API
The easiest way to get a transcript for a given video is to execute:
This will return a list of dictionaries looking somewhat like this:
You can also add the languages
param if you want to make sure the transcripts are retrieved in your desired language (it defaults to english).
It's a list of language codes in a descending priority. In this example it will first try to fetch the german transcript ('de'
) and then fetch the english transcript ('en'
) if it fails to do so. If you want to find out which languages are available first, have a look at list_transcripts()
To get transcripts for a list of video ids you can call:
languages
also is optional here.
List available transcripts
If you want to list all transcripts which are available for a given video you can call:
This will return a TranscriptList
object which is iterable and provides methods to filter the list of transcripts for specific languages and types, like:
By default this module always picks manually created transcripts over automatically created ones, if a transcript in the requested language is available both manually created and generated. The TranscriptList
allows you to bypass this default behaviour by searching for specific transcript types:
The methods find_generated_transcript
, find_manually_created_transcript
, find_generated_transcript
return Transcript
objects. They contain metadata regarding the transcript:
and provide the method, which allows you to fetch the actual transcript data:
Translate transcript
Youtube Get Comment Translations Free
YouTube has a feature which allows you to automatically translate subtitles. This module also makes it possible to access this feature. To do so Transcript
objects provide a translate()
method, which returns a new translated Transcript
object:
By example
Using Formatters
Formatters are meant to be an additional layer of processing of the transcript you pass it. The goal is to convert the transcript from its Python data type into a consistent string of a given 'format'. Such as a basic text (.txt
) or even formats that have a defined specification such as JSON (.json
), WebVTT format (.vtt
), Comma-separated format (.csv
), etc..
The formatters
submodule provides a few basic formatters to wrap around you transcript data in cases where you might want to do something such as output a specific format then write that format to a file. Maybe to backup/store and run another script against at a later time.
We provided a few subclasses of formatters to use:
- JSONFormatter
- PrettyPrintFormatter
- TextFormatter
- WebVTTFormatter (a basic implementation)
Here is how to import from the formatters
module.
Provided Formatter Example
Lets say we wanted to retrieve a transcript and write that transcript as a JSON file in the same format as the API returned it as. That would look something like this:
Passing extra keyword arguments
Since JSONFormatter leverages json.dumps()
you can also forward keyword arguments into .format_transcript(transcript)
such as making your file output prettier by forwarding the indent=2
keyword argument.
Custom Formatter Example
You can implement your own formatter class. Just inherit from the Formatter
base class and ensure you implement the format_transcript(self, transcript, **kwargs)
and format_transcripts(self, transcripts, **kwargs)
methods which should ultimately return a string when called on your formatter instance.
CLI
Execute the CLI script using the video ids as parameters and the results will be printed out to the command line: Resident evil 4 pc mouse aim patch.
The CLI also gives you the option to provide a list of preferred languages:
You can also specify if you want to exclude automatically generated or manually created subtitles:
If you would prefer to write it into a file or pipe it into another application, you can also output the results as json using the following line:
Translating transcripts using the CLI is also possible:
If you are not sure which languages are available for a given video you can call, to list all available transcripts:
If a video's ID starts with a hyphen you'll have to mask the hyphen using to prevent the CLI from mistaking it for a argument name. For example to get the transcript for the video with the ID
-abc123
run:
Proxy
You can specify a https/http proxy, which will be used during the requests to YouTube:
As the proxies
dict is passed on to the requests.get(..)
call, it follows the format used by the requests library.
Using the CLI:
Cookies
Some videos are age restricted, so this module won't be able to access those videos without some sort of authentication. To do this, you will need to have access to the desired video in a browser. Then, you will need to download that pages cookies into a text file. You can use the Chrome extension cookies.txt or the Firefox extension cookies.txt.
Once you have that, you can use it with the module to access age-restricted videos' captions like so.
Using the CLI:
Warning
This code uses an undocumented part of the YouTube API, which is called by the YouTube web-client. So there is no guarantee that it won't stop working tomorrow, if they change how things work. I will however do my best to make things working again as soon as possible if that happens. So if it stops working, let me know!
Donation
If this project makes you happy by reducing your development time, you can make me happy by treating me to a cup of coffee :)
Release historyRelease notifications | RSS feed
0.4.1
0.4.0
0.3.1
0.3.0
0.2.1
0.2.0
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
Mazda speed 3 beamng. 0.1.2
0.1.1
0.1.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size youtube_transcript_api-0.4.1-py3-none-any.whl (22.8 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size youtube_transcript_api-0.4.1.tar.gz (21.9 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for youtube_transcript_api-0.4.1-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | ad592f91cccc42093d4a2d680383d1a93b9ac4e5a747e4baa7be5d7f71b96c04 |
MD5 | a3a769af8b08027f1b6a97d98778fbb8 |
BLAKE2-256 | c924581920922d80f6d6d2feb30787aa4d9e298db83cb081c1de1a63cc7cf121 |
Hashes for youtube_transcript_api-0.4.1.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 69c208c220b2a4b3e4e86366cde321bc1c3cea79e8e8b8bbc1249b703e7b8f73 |
MD5 | 765d7b85d4c242a599d76852b9b54d41 |
BLAKE2-256 | d920e10614dd94ef091e1365cbba22d3071b965636815c85ab3521ea84ad4061 |
Grow your YouTube channel with real and active subscribers.
Buy cheap YouTube views, likes and comments with lifetime warranty.
- I started using this because I couldn't find an audience on my channel. but as soon as I started using this not only did I get a big bump start I also got external views from people recommending my content from this website! 10/10 Would always recommend
- I have gottena few subs so far and hope to get more soon. This site works unlike a lot of other youtube subscribers sites which just don't work.
- This site brings subs! I'm am not paid this is a real response. It would be nice if they included a more strict sub-requirement for people to not unsub. Overall this site has helped me reach 100 subs so I'm very happy!
- The best place to get free youtube subscribers .. really appreciate it
- This Website is best for free Subscribers
- Getting extra views and subscribers are always usefull. Try this website out and you won't regret it.
- This is good site to gain free subscribers.
- My experience is a very cool siteThanks
- A really good website to earn legit subscribers.
- They Provide You what you need and give everything timely
- Time needed: 4 minutes
- Subscribers / day: 10
- Subscriptions / day: 20
- Manual activation
- Once a day
- Free
- Time needed: 6 minutes
- Subscribers / day: 15
- Subscriptions / day: 30
- Manual activation
- Once a day
- Free
- Time needed: 10 minutes
- Subscribers / day: 20
- Subscriptions / day: 40
- Manual activation
- Once a day
- Free
- Natural growth pattern
- 3 day risk-free trial
- Full refund during a trial
- Get subscribers: 10 - 15
- Get likes: 7 - 15
- Get views: 15 - 100
- Once a day
- Automatic
- Recurring payment
- 22 $ / month
- Natural growth pattern
- 3 day risk-free trial
- Full refund during a trial
- Get subscribers: 20 - 30
- Get likes: 15 - 30
- Get views: 30 - 150
- Once a day
- Automatic
- Recurring payment
- 44 $ / month
- Natural growth pattern
- Can be stopped any time
- Pro-rated refund
- Get subscribers: 40 - 60
- Get likes: 30 - 60
- Get views: 60 - 250
- Once a day
- Automatic
- Recurring payment
- 95 $ / month
Guaranteed delivery. Best price. Up to 6 months warranty.
Delegate your promotion to professionals!
Facebook Twitter Instagram
Only real people views, likes and followers. No bots or proxies.
Up to 6 months warranty. Free bonus with every purchase.
All promotions are legal, safe, secure and private.
Need help? We guarantee you response within 24 hours.
Youtube Get Comment Translations Videos
Committed to your satisfaction. Ready to exceed expectations!
Youtube Get Comment Translations Download
Hyperium client. All major cards are accepted. No PayPal account needed.