Skip to main content

Library for getting music and video in high quality from YouTube

Project description




Library for downloading and converting YouTube music to MP3 with comprehensive testing and CI/CD.
(Optimized for Linux systems).


Installation

System Dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install ffmpeg yt-dlp -y

Install via pip

pip3 install tubemp3 -U

Usage

CLI Example

tubemp3 "https://music.youtube.com/watch?v=Wy_6jN1Yrx8&si=pgL_4Ozjafkkms8X" "/sdcard/Alarms/root_kali.mp3"
Sample Output
tube search info:
file: /sdcard/Alarms/root_kali.mp3
link: https://music.youtube.com/watch?v=Wy_6jN1Yrx8&si=pgL_4Ozjafkkms8X
search: False
info music link:
'title': '3.1_4-root@kali.0cc'
'artist': 'Mac Quayle'
'album': 'Mr. Robot, Vol. 5'
'duration': '152'
'format': 'webm'
'filesize': '3091263'
...
converting to MP3...
saving metadata...

Python API

Download via URL

from tubemp3 import get_info_link as gil
from tubemp3.file import download

music = gil("https://music.youtube.com/watch?v=yspAcpXEzSM")
download(music)

Search and Download

from tubemp3 import search_music
from tubemp3.file import download

music = search_music("like a player wolverine deadpool chor")[0]
download(music)

Get Metadata Only

from tubemp3 import search_music

query = "like a player wolverine deadpool chor"
music = search_music(query)[0]

for key, value in music.items():
    print(f"{key}: {value}")

Info from link

from tubemp3 import search_music
from tubemp3  import get_info_link
from kitano import puts

    query = "like a player wolverine deadpool chor"
    musics = search_music(query)

    assert len(musics) > 0
    puts(f"Total musics found: {len(musics)}")

    music = musics[0]
    info = get_info_link(music.url)
    puts('--- Music Info ---')
    puts(info)
---

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

tubemp3-0.4.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file tubemp3-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: tubemp3-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for tubemp3-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d2b10c498d2c6994404ee3c3d2f1b66b4b0bd1b142664abb9021db00e52306b
MD5 ff85ca82bcb0f076e5e8c6ba5720fc6c
BLAKE2b-256 f65ae483922353243d576f3b6d8de00e8b3229d3bc7bce0352fce223411d49f3

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