Comments (8)
@SetUpSim, Hello!
I have a question for you:
If you are using the Telebot library, why are you sending a naked request to API telegram, this library already has methods for downloading files.
I already have a project that you want to implement:
https://github.com/dotX12/ShazamBot
An asynchronous library for working with telegram is used here (aiogram).
from shazamio.
A piece of Telebot documentation:
# getFile
# Downloading a file is straightforward
# Returns a File object
import requests
file_info = tb.get_file(file_id)
file = requests.get('https://api.telegram.org/file/bot{0}/{1}'.format(API_TOKEN, file_info.file_path))
So I'm sending a naked request to Telegram API to download files because Telebot
appears to have no API method for doing this.
Thank you for your advice on aiogram
, but I'm currently mastering another library. And here a strange bug reveals, so I would like you to maybe clear the things out for me.
from shazamio.
@SetUpSim,
In fact, I changed almost nothing, your code worked for me, only changed the launch of an asynchronous function in a loop.
https://carbon.now.sh/qH4Jci9HPh2uboq9tNDz
from shazamio.
Console:
File hierarchy:
from shazamio.
@dotX12 Your code still raises FileNotFoundError for me.
What's your Python version? Mine is 3.9.0
from shazamio.
Check if your files are saved?
If so, maybe they will be saved to a different location, relative to your bot file.
from shazamio.
@SetUpSim, Ahhh, sorry man...
RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
You need to install ffmpeg.
from shazamio.
Yep, that was the thing. Thank you
from shazamio.
Related Issues (20)
- Failed to build when running pip install HOT 3
- Call recognize on AudioSegment HOT 1
- shazamio.exceptions.FailedDecodeJson: Failed to decode json HOT 2
- `top_country_tracks` does not return tracks
- Youtube URL
- Unable to pip install shazamio on macos HOT 2
- Is it possible to query about genre of certain track and artist name
- Realtime recognition by audio frames
- Several song mis-matches HOT 2
- Can we access the database? HOT 1
- Pydantic compatibility issue HOT 2
- Invalid URL HOT 27
- dependency conflicts. HOT 1
- How to identify multiple songs in a mp4 file?🤔 HOT 2
- Quota or changes to the API recently ? HOT 4
- Does shazamio work with audio playing from URL instead of a file? HOT 1
- Ошибка recognize_song() HOT 7
- How long in seconds can ShazamIO analyze? HOT 3
- SignatureError: end of stream HOT 5
- Getting album from song/artist HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shazamio.