GithubHelp home page GithubHelp logo

bdim404 / music-download-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 114 KB

Downloads music telegram bot by python (support Apple Music & Spotify now)

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

music-download-telegram-bot's Introduction

music-download-telegram-bot

An Apple Music & Spotify Music Telegram bot downloader created with Python!

Features

  • Download songs in 256kbps AAC or 64kbps HE-AAC for high-quality audio experience.
  • FFmpeg Integration for advanced users to remux audio without re-encoding, preserving original quality.
  • yt-dlp Utilization for efficient and reliable downloading from music platforms.
  • Customization Options to tailor the bot's behavior to your specific needs.

News!

  • Add the function of posting while downloading, you can download OVER 100 songs playlist at a time.(29/3/2024)

Installation

Before proceeding, ensure that you have FFmpeg installed on your system.

Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/bdim404/music-download-telegram-bot.git
  2. Create a .env File:

    • Navigate to the project directory.
    • Create a .env file and insert your Telegram bot token.
  3. Provide Necessary Files:

    • Place your cookies.txt and device.wvd files in the project directory, or specify their paths in the .env file.
  4. Install Dependencies:

    pip install -r requirements.txt
  5. Run the Main Script:

    • Navigate to the src directory.
    • Execute main.py to start the bot:
      cd src
      python main.py

Important Notes

  • Follow the installation steps carefully to avoid any errors during setup.
  • This bot sends songs through a media group, so make sure you have a channel that holds a cache of songs.
  • Ensure that your Telegram bot token and the files cookies.txt and device.wvd are valid and up-to-date for the bot to function correctly.
  • Check your internet connection before running the bot to ensure smooth access to GitHub and the FFmpeg website.

Thanks

Thanks gamdl

Donate

If you like the bot, you can support the developer!

https://ko-fi.com/bdim404

music-download-telegram-bot's People

Contributors

bdim404 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

music-download-telegram-bot's Issues

upload issue

uploading takes way too much time :(

checked the console and saw

ERROR - Error: Timed out
2024-05-11 23:51:19,389 - root - ERROR - Error: Timed out
2024-05-11 23:51:26,195 - root - ERROR - Error: Timed out
2024-05-11 23:51:32,992 - root - ERROR - Error: Timed out
2024-05-11 23:51:41,093 - root - ERROR - Error: Timed out
Error: Timed out
2024-05-11 23:57:05,516 - root - ERROR - An error occurred while sending the song
Traceback (most recent call last):
File "/root/fin/src/apple_music_checker.py", line 510, in send_group_song
media = InputMediaAudio(media=file_id)
^^^^^^^
UnboundLocalError: cannot access local variable 'file_id' where it is not associated with a value

also can you use pyrogram instead of regular bot upload since it's limit is 50mb

image

also i think it uploads single track way too many times

no artist support

gamdl supports entire discography or apple artist link support. Can we get that in this bot too? or that alac, binaural etc?

cookies.txt and device.wvd error

Hello, sorry for the stupid question, but how and with what help can I create cookies.txt and device.wvd files to run the script correctly?

Reply audio function usage not right.

Here we have reply_audio function:

https://github.com/bdim404/AMdlBOT/blob/0fd727510e4e6dad455163b9ac263a4a9f75109e/main.py#L113

As documentation said here:

async reply_audio(audio, duration=None, performer=None, title=None, caption=None, disable_notification=None, reply_to_message_id=None, reply_markup=None, parse_mode=None, allow_sending_without_reply=None, caption_entities=None, protect_content=None, message_thread_id=None, thumbnail=None, reply_parameters=None, *, filename=None, quote=None, do_quote=None, read_timeout=None, write_timeout=None, connect_timeout=None, pool_timeout=None, api_kwargs=None)

So we don't need to add chat_id here, it can simply be reply_audio(songFile).

wvd and cookies are in directory still

Traceback (most recent call last):
File "/home/ubuntu/abo/src/main.py", line 5, in
from apple_music_checker import AppleMusicChecker
File "/home/ubuntu/abo/src/apple_music_checker.py", line 20, in
downloader = Downloader()
File "/home/ubuntu/abo/src/apple_music_downloader.py", line 53, in init
self.wvd_location = Path(WVD_LOCATION)
File "/usr/lib/python3.10/pathlib.py", line 960, in new
self = cls._from_parts(args)
File "/usr/lib/python3.10/pathlib.py", line 594, in _from_parts
drv, root, parts = self._parse_args(args)
File "/usr/lib/python3.10/pathlib.py", line 578, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.