Skip to main content

一個用於下載 YouTube 影片字幕的工具

Project description

讓我幫您修改 README.md 來反映您程式碼和檔案名稱的變更(從 youtube_transcript 到 cameo_youtube_transcript)。以下是修改後的 README.md:

# Cameo Youtube Transcript Downloader
Cameo Youtube Transcript Downloader 是一個 Python 套件,它可以簡單地從 YouTube 影片下載字幕。此工具可以透過 Python 庫的方式使用,也可以在命令列界面運行。

## 安裝
使用以下命令安裝 Cameo Youtube Transcript Downloader:
```sh
python3 -m pip install cameo-youtube-transcript

或者從 GitHub 安裝:

python3 -m pip install git+https://github.com/bohachu/cameo_youtube_transcript.git

套件用法

在 Python 程式可以透過以下方式匯入並使用 Cameo Youtube Transcript Downloader:

from cameo_youtube_transcript import cameo_youtube_transcript

# 下載字幕
cameo_youtube_transcript(url, username, output_folder)

其中,url 是您要下載字幕的 Youtube 影片網址,username 是您的使用者名稱,output_folder 是存放輸出目錄的路徑。

命令列界面用法

在命令列界面,可以直接運行模組:

cameo_youtube_transcript

命令列界面提供以下參數:

  • urls: Youtube 影片網址(必填)
  • --username, -u: 使用者名稱(可選,預設為 "cbh@cameo.tw")
  • --folder, -f: 輸出目錄的路徑(可選)

範例:

cameo_youtube_transcript "https://www.youtube.com/watch?v=dQw4w9WgXcQ" -u "cbh@cameo.tw" -f "/path/to/output/folder"

功能特色

  • 支援繁體中文字幕優先下載
  • 如果找不到繁體中文字幕,會自動使用第一個可用的字幕
  • 將下載的字幕儲存為 JSON 格式,包含影片 URL、字幕內容等資訊
  • 可同時處理多個 YouTube 影片 URL

輸出範例

{
  "user": "cbh@cameo.tw",
  "type": "youtube_transcript",
  "time": "2023-05-21T04:21:18Z",
  "id": "23b9242f-2f62-42e8-bdbe-f65241d2ac5a",
  "url": "https://www.youtube.com/watch?v=HEquaCEckwg",
  "transcript": "0:00\nsummary of finish big by bill birlingham\n0:04\nwritten by lee schullery in quick read\n0:06\nnarrated\n0:07\nby alex smith introduction\n0:11\nthe truth is that every entrepreneur\n..."
}

版本歷史

  • 1.1.0 (現在版本)
    • 更新功能以優先支援繁體中文字幕
  • 1.0.4
    • 更名為 cameo-youtube-transcript
    • 加入 print 列印直接顯示
  • 1.0.3
    • 改名字從 youtube_transcript_downloader 到 youtube_transcript 避免撞名 pypi
  • 1.0.2
    • 新增加 README.md 完整說明

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cameo_youtube_transcript-1.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cameo_youtube_transcript-1.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file cameo_youtube_transcript-1.1.0.tar.gz.

File metadata

File hashes

Hashes for cameo_youtube_transcript-1.1.0.tar.gz
Algorithm Hash digest
SHA256 82d851f7c1eb471f51b1f56b704cacd8b7c2433ca8469e45a15ecfe00c2aebe3
MD5 7d429490521cae6ddaa4125a8376b3f3
BLAKE2b-256 844e9b7a3d66a49ade6854550ac205c7e3ec270329f76bc0b80dc9f532501afb

See more details on using hashes here.

File details

Details for the file cameo_youtube_transcript-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cameo_youtube_transcript-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d680e5416ea32435b5751a3ee121989f38c19373c84243399e6bf5b8496c7b60
MD5 845bd57d69bef93c917af255fd877652
BLAKE2b-256 edcdd966f187799708b411042efebf975ddb272071db426fb12c82f2815c5854

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page