slyyxp / bugspy Goto Github PK
View Code? Open in Web Editor NEWBugsPy is a tool for downloading streamable tracks from Bugs.co.kr
BugsPy is a tool for downloading streamable tracks from Bugs.co.kr
downloads_directory is set to ~/DOWNLOADS. Instead of the expected behavior, all album folders are placed in the current directory, with the desired directory appended to the start of the filename:
Additionally, although the in-progress downloads appear in the correct album folder, the completed tracks are again placed in the current working directory.
It seems that utils.sanitize() is being called on the entire file path, which replaces the slashes with underscores making it no longer a valid path. The one path that is not sanitized in this way is pre_path, which is why the in-progress downloads do not appear in the cwd but everything else does. I made a few changes so that utils.sanitize() is only called on the actual folder name instead of the entire path and it solved the problem. Platform is linux but this should cause issues on all platforms if I'm not mistaken.
Hi, Slyy.
When I try to download this album, I get this error.
Log:
2020-09-02 13:41:44 Utilities DEBUG System Information: uname_result(system='Windows', node='Sancheesze-PC', release='7', version='6.1.7601', machine='x86', processor='x86 Family 6 Model 15 Stepping 13, GenuineIntel')
2020-09-02 13:41:44 Utilities DEBUG Python Version: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]
2020-09-02 13:41:44 Utilities DEBUG Preferences: {'log_directory': 'logs', 'downloads_directory': 'downloads', 'artist_folders': True, 'cover_size': '500', 'cover_name': 'cover.jpg', 'lyrics_type': 'N'}
2020-09-02 13:41:45 Client INFO Login Successful
2020-09-02 13:41:45 Client DEBUG Nickname:
2020-09-02 13:41:45 Client DEBUG Subscription Plan: Premium 듣기(매월)
2020-09-02 13:41:45 Client DEBUG Stream: {'is_premium': False, 'is_limit': False, 'is_cellular_flac': True, 'is_flac_premium': True, 'is_offlineplay': False, 'pssrl_key': None, 'is_datafree': False, 'is_dataplus': False, 'date_begin': 1597889399000, 'date_end': 1600567787000, 'is_mobile_platform': True, 'is_pc_platform': True, 'count_remain': 0, 'device': None, 'date_expire': 1600613999000}
2020-09-02 13:41:45 Bugs DEBUG ID: 993486. URL: https://music.bugs.co.kr/album/993486?wl_ref=list_ab_01.
2020-09-02 13:41:47 Bugs INFO Album: 루나솔라(LUNARSOLAR) - SOLAR : flare.
https://music.bugs.co.kr/album/130004
some albums not have album cover.
changed some to prevent error
def download_cover(imgs, cover_path):
if utils.exist_check(cover_path):
pass
else:
logger_bugs.info("Downloading cover artwork.")
cover_url = imgs[config.prefs['cover_size']]
r = requests.get(cover_url)
if r:
r.raise_for_status()
with open(cover_path, 'wb') as f:
f.write(r.content)
else:
cover_path = ""
can you add batch download from urls_list.txt?
Thank you very much for fixing the issue.
I found this error when trying to download this album.
Log:
2020-09-02 14:11:59 Utilities DEBUG System Information: uname_result(system='Windows', node='Sancheesze-PC', release='7', version='6.1.7601', machine='x86', processor='x86 Family 6 Model 15 Stepping 13, GenuineIntel')
2020-09-02 14:11:59 Utilities DEBUG Python Version: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]
2020-09-02 14:11:59 Utilities DEBUG Preferences: {'log_directory': 'logs', 'downloads_directory': 'downloads', 'artist_folders': True, 'cover_size': '500', 'cover_name': 'cover.jpg', 'lyrics_type': 'N'}
2020-09-02 14:12:00 Client INFO Login Successful
2020-09-02 14:12:00 Client DEBUG Nickname:
2020-09-02 14:12:00 Client DEBUG Subscription Plan: Premium 듣기(매월)
2020-09-02 14:12:00 Client DEBUG Stream: {'date_begin': 1597889399000, 'date_end': 1600567787000, 'is_mobile_platform': True, 'is_pc_platform': True, 'count_remain': 0, 'is_premium': False, 'is_limit': False, 'is_cellular_flac': True, 'is_flac_premium': True, 'is_offlineplay': False, 'pssrl_key': None, 'is_datafree': False, 'is_dataplus': False, 'date_expire': 1600613999000, 'device': None}
2020-09-02 14:12:00 Bugs DEBUG ID: 903892. URL: https://music.bugs.co.kr/album/903892?wl_ref=list_ab_03_ar.
2020-09-02 14:12:02 Bugs INFO Album: Ohara Sakurako(From MUSH&Co.)(오하라 사쿠라코/大原櫻子) - CAM ON!~5th Anniversary Best~.
2020-09-02 14:12:02 Bugs INFO Downloading cover artwork.
2020-09-02 14:12:04 Bugs INFO Track: 1. サンキュー。 / Thank You
I just realized it's not possible to download single tracks with BugsPy. Could single track support be added?
This URL template for example, https://music.bugs.co.kr/track/80253599
Thank you very much for your active response each time.
When I try to download an album as an artist, I cannot download it.
16.29.15.log
Hi, Slyy~
When I tried to download this artist’s album, the following error occurred and the download could not be completed
If the problem cannot be fixed, please let the downloader skip the album and continue to the next album
Thank you very much
Some way to get 24bits?
I have a premium flac subscription to listen in high quality.
need help,I get some errors when downloading the album,thx!
Client : INFO Login Successful
Bugs : INFO Album: JK 김동욱 - Life Sentence [2002.05.18].
Bugs : INFO Downloading cover artwork.
Bugs : INFO dl2\JK 김동욱 - Life Sentence [2002.05.18]\1. 다신 없겠죠.flac already exists.
Bugs : INFO Track: 2. 미련한 사랑
100%|█████████████████████████████████████████████████████████████████████████████| 30.3M/30.3M [00:04<00:00, 7.91MB/s]
Traceback (most recent call last):
File "X:\Bugs\bugs.py", line 266, in
main()
File "X:\Bugs\bugs.py", line 243, in main
album_rip(album_id=id)
File "X:\Bugs\bugs.py", line 144, in album_rip
tag(album=meta, track=track, file_path=post_path, cover_path=cover_path)
File "X:\Bugs\bugs.py", line 185, in tag
lyrics = get_lyrics(track['lyrics_tp'], track['track_id'])
File "X:\Bugs\bugs.py", line 172, in get_lyrics
lyrics = ("\n".join(
File "X:\Bugs\bugs.py", line 173, in
f'[{datetime.fromtimestamp(round(float(a), 2)).strftime("%M:%S.%f")[0:-4]}]{b}' for a, b in
ValueError: Invalid value NaN (not a number)
This is for the specific case "YEAR.X?.X?"
for example, date on bugs is "1991.10.01" or "1991.11(.00)", the files will be tagged "1991.01.01"
Please help me download video HD from bugs.co.kr. Thanks so much.
Thanks for fixing the bug.
The two things I'll mention below aren't bugs, but I'd like to suggest if they can be fixed.
When downloading as an artist, the album seems to receive three types of albums as shown in the image below.
Release(발매) / Participation(참여) / Compilation(컴필레이션).
I wish I could only get the official release album, is that possible?
Will 24-bit ripping functionality ever be added? Unless there's something I'm missing. iirc the massive /kpg/ torrent uses BugsPy and has 24-bit files included when they're available, but I'm unsure if they're downloaded legitimately through Bugs vs ripped
hi I get this error when downloading
Client : INFO Login Successful
Bugs : INFO Album: 이나래 - like a star [2017.07.05].
Bugs : INFO Downloading cover artwork.
Bugs : INFO Track: 1. like a star
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.80M/8.80M [00:20<00:00, 444kB/s]
Bugs : WARNING _writeblock error, falling back to a smaller cover artwork.
Bugs : INFO Downloading cover artwork.
Traceback (most recent call last):
File "bugs.py", line 144, in album_rip
tag(album=meta, track=track, file_path=post_path, cover_path=cover_path)
File "bugs.py", line 189, in tag
f_file = FLAC(file_path)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_file.py", line 48, in init
self.load(*args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_util.py", line 185, in wrapper
return func(*args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_util.py", line 156, in wrapper
return func(self, h, *args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen\flac.py", line 796, in load
self.__check_header(fileobj, filething.name)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen\flac.py", line 918, in __check_header
raise FLACNoHeaderError(
mutagen.flac.FLACNoHeaderError: 'downloads\이나래 - like a star [2017.07.05]\1. like a star.flac' is not a valid FLAC file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bugs.py", line 266, in
main()
File "bugs.py", line 243, in main
album_rip(album_id=id)
File "bugs.py", line 151, in album_rip
tag(album=meta, track=track, file_path=post_path, cover_path=cover_path)
File "bugs.py", line 189, in tag
f_file = FLAC(file_path)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_file.py", line 48, in init
self.load(*args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_util.py", line 185, in wrapper
return func(*args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen_util.py", line 156, in wrapper
return func(self, h, *args, **kwargs)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen\flac.py", line 796, in load
self.__check_header(fileobj, filething.name)
File "C:\Users\kelsey\AppData\Local\Programs\Python\Python38\lib\site-packages\mutagen\flac.py", line 918, in __check_header
raise FLACNoHeaderError(
mutagen.flac.FLACNoHeaderError: 'downloads\이나래 - like a star [2017.07.05]\1. like a star.flac' is not a valid FLAC file
Hi~ Slyy.
First of all thank you for your works
When I try to download this album, I get this error. 09.49.56.log
=================================================================================
And here is another similar problem. Because of the locked album, the download of the artist’s album cannot be completed.
10.04.00.log
Hi, Slyy
I find a new Error, when i try to download this album and it traceback:
and log here:
python bugs.py -u https://music.bugs.co.kr/artist/3373
Client : INFO Login Successful
Bugs : INFO Artist: 이은미 | Album Count: 149
Bugs : INFO Downloading Album #1 of #149.
Bugs : INFO Album: 이은미 - 흠뻑 [2019.09.25].
Bugs : INFO Track: 2. 어제 낮
100%|█████████████████████████████████████| 25.7M/25.7M [00:07<00:00, 3.62MB/s] Traceback (most recent call last):
File "bugs.py", line 202, in <module>
main()
File "bugs.py", line 191, in main
artist_rip(artist_id=id)
File "bugs.py", line 54, in artist_rip
album_rip(album['album_id'])
File "bugs.py", line 97, in album_rip
tag(album=meta, track=track, file_path=post_path, cover_path=cover_path)
File "bugs.py", line 144, in tag
f_file.save()
File "C:\Python38\lib\site-packages\mutagen\_util.py", line 185, in wrapper
return func(*args, **kwargs)
File "C:\Python38\lib\site-packages\mutagen\_util.py", line 156, in wrapper
return func(self, h, *args, **kwargs)
File "C:\Python38\lib\site-packages\mutagen\flac.py", line 848, in save
self._save(filething, self.metadata_blocks, deleteid3, padding)
File "C:\Python38\lib\site-packages\mutagen\flac.py", line 864, in _save
data = MetadataBlock._writeblocks(
File "C:\Python38\lib\site-packages\mutagen\flac.py", line 154, in _writeblocks
data += cls._writeblock(block)
File "C:\Python38\lib\site-packages\mutagen\flac.py", line 137, in _writeblock
raise error("block is too long to write")
mutagen.flac.error: block is too long to write
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.