File size: 1,317 Bytes
280855a
a26dd44
 
 
 
280855a
a26dd44
280855a
 
 
a26dd44
280855a
a26dd44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
title: YouTube Translator and Speaker
emoji: 🌍
colorFrom: yellow
colorTo: blue
sdk: gradio
sdk_version: 5.28.0
app_file: app.py
pinned: false
---
# YouTube Translator and Speaker

This HuggingFace Space application allows you to get the translated transcript and speech for a given YouTube video.

## How to Use

1. Enter the YouTube Video ID in the provided text box.
   (The video ID is the unique string of characters in the YouTube video URL after `v=`, e.g., `dQw4w9WgXcQ`)
2. Select the target language from the dropdown menu.
3. The translated text will appear in the 'Translated Text' box, and the translated speech will play automatically.

## Supported Languages

- Arabic (ar)
- French (fr)
- Hausa (ha)
- Afghan Persian / Dari (fa)
- Pashto (ps)

## Notes

- Translation for Arabic and French uses Helsinki-NLP models.
- Translation for Hausa, Afghan Persian, and Pashto uses the Facebook NLLB-200 model.
- Speech generation for Arabic and French uses gTTS.
- Speech generation for Hausa, Afghan Persian, and Pashto uses the ElevenLabs API. An ElevenLabs API key is required as a Space secret named `ELEVENLABS_API_KEY` for speech to work in these languages.
- Proxy settings for YouTube transcript retrieval can be configured using Space secrets named `WEBSHARE_PROXY_UN` and `WEBSHARE_PROXY_PW`.