Comments (25)
Will test playlist too.
from tidalgrabber.
Try to change raw_input to input
from tidalgrabber.
What version of python do you use?
from tidalgrabber.
Python 3.7.2
from tidalgrabber.
Did you try to change raw_input() to input()?
from tidalgrabber.
But when trying to grab a playlist or album, I get this:
from tidalgrabber.
Try to use branch "python3", but don't forget this script uses wget
from tidalgrabber.
I will use python downloading using requests instead of wget, but I can't do it now
from tidalgrabber.
Awesome!
Just FYI:
However, Search feature in your script is working with:
browser = 'wdgaB1CilGA-S_s2' # Streams HIGH/LOW Quality over RTMP, FLAC and Videos over HTTP, but many Lossless Streams are encrypted.
native = '4zx46pyr9o8qZNRw' # Same as Android Token, but FLAC streams are encrypted
audirvana = 'BI218mwp9ERZ3PFI' # Like Android Token, supports MQA, but returns 'numberOfVideos = 0' in Playlists
amarra = 'wc8j_yBJd20zOmx0' # Like Android Token, but returns 'numberOfVideos = 0' in Playlists
token2 = 'oIaGpqT_vQPnTr0Q' # Like token1, but uses RTMP for HIGH/LOW Quality
Search feature in your script is NOT working with:
token1 = 'P5Xbeo5LFvESeDy6' # Like Android Token, but returns 'numberOfVideos = 0' in Playlists
token3 = '_KM2HixcUBZtmktH' # Same as token1
android = 'kgsOOmYk3zShYrNP' # All Streams are HTTP Streams. Correct numberOfVideos in Playlists
ios = '_DSTon1kC8pABnTw' # Same as Android Token, but uses ALAC instead of FLAC
from tidalgrabber.
By default I use this token “audirvana = 'BI218mwp9ERZ3PFI' # Like Android Token, supports MQA, but returns 'numberOfVideos = 0' in Playlists”
from tidalgrabber.
Now script works, normally?
from tidalgrabber.
Only, the search function.
- I will look into python3 branch (not sure what the difference is between my installed Python 3.7.2 and python3)
- will pip install wget, I assume
from tidalgrabber.
from tidalgrabber.
No, if you want to work with python3 you need to grab script from this repository from branch “python3”
from tidalgrabber.
from tidalgrabber.
from tidalgrabber.
OK, I understood. I have the same problem, I will fix it after I charge my laptop.
from tidalgrabber.
\o/
from tidalgrabber.
Try to add this function def download(url, file_name): with open(file_name, "wb") as file: response = get(url)
, this to start of file from requests import get
. And then replace os.system('wget "'+url+'" -O "music/'+name+'.flac"') os.system('wget "'+track.album.image+'" -O "music/'+name+'.png"')
with download(url, 'music/'+name+'.flac') download(track.album.image, name+'.png')
from tidalgrabber.
I wrote this from my phone
from tidalgrabber.
# -*- coding: utf-8 -*-
# vim:fileencoding=utf-8
import tidalapi
from transliterate import translit
import os
from mutagen.flac import Picture, FLAC
from requests import get
session = tidalapi.Session(tidalapi.Config('LOSSLESS'))
session._config.api_token='BI218mwp9ERZ3PFI'
session.login('[email protected]', 'xxx')
def download(url, file_name):
with open(file_name, "wb") as file: response = get(url)
def start():
mode = input("Mode: \n 1) Playlist grabber\n 2) Track grabber\n 3) Album grabber\n 4) Search \n")
if int(mode) == 1:
playlist_id = input("Enter playlist id: ")
playlist = session.get_playlist_tracks(playlist_id=playlist_id)
for track in playlist:
download_flac(track)
want_start()
elif int(mode) == 2:
track_id = input("Enter track id: ")
track = session._map_request('tracks/'+str(track_id), params={'limit': 100}, ret='tracks')
download_flac(track)
want_start()
elif int(mode) == 3:
album_id = input("Enter album id: ")
album = session.get_album_tracks(album_id=album_id)
for track in album:
download_flac(track)
want_start()
elif int(mode) == 4:
search_query = input("Enter search query: ")
search = session.search(field='track', value=search_query)
for track in search.tracks:
print(track.artist.name+" - "+track.name+": "+str(track.id))
want_start()
else:
print("Incorrect mode!")
start()
def download_flac(track):
url = session.get_media_url(track_id=track.id)
name = translit(""+track.name, "ru", reversed=True)
artist_name = translit(""+track.artist.name, "ru", reversed=True)
album_name = translit(""+track.album.name, "ru", reversed=True)
releaseDate = str(track.album.release_date)
print(name+' - '+url)
album_artist = translit(u""+track.album.artist.name, "ru", reversed=True).encode("UTF-8")
print('wget "'+url+'" -O "music/'+name+'.flac"')
download(url, 'music/'+name+'.flac')
download(track.album.image, name+'.png')
audio = FLAC("music/"+name+".flac")
albumart = "music/"+name+".png"
image = Picture()
image.type = 3
mime = 'image/png'
image.desc = 'front cover'
with open(albumart, 'rb') as f: # better than open(albumart, 'rb').read() ?
image.data = f.read()
audio['artist'] = artist_name
audio['title'] = name
audio['album'] = album_name
audio['date'] = releaseDate
audio.add_picture(image)
audio.save()
os.remove("music/"+name+".png")
def want_start():
want = input("Do you want to continue [0/1]: ")
if want == "1":
start()
elif want == "0":
print("OK!")
else:
want_start()
start()
#playlist = session.get_playlist_tracks(playlist_id='004a984e-6f9e-44ed-a447-9c3dd4b0405f')
#for track in playlist:
# url = session.get_media_url(track_id=track.id)
# name = translit(u""+track.name, "ru", reversed=True).encode("UTF-8")
# print(name+' - '+url)
# os.system('wget "'+url+'" -O "music/'+name+'.flac"'.encode('utf-8'))
from tidalgrabber.
Use new update of python3
from tidalgrabber.
python3 branch
from tidalgrabber.
OK, can I close this issue?
from tidalgrabber.
Let's.
And focus on playlist, cause it errors after a bit.
from tidalgrabber.
Related Issues (5)
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 tidalgrabber.