Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private tracks bypass - ONLY if private tracks are accessible online #216

Open
ArmSob opened this issue Jan 19, 2024 · 2 comments
Open

Private tracks bypass - ONLY if private tracks are accessible online #216

ArmSob opened this issue Jan 19, 2024 · 2 comments
Assignees

Comments

@ArmSob
Copy link

ArmSob commented Jan 19, 2024

Hello,

I have modified some bit of code because I have a subscription to an artist that allow me to listen online only if I have paid. Otherwise, tracks are not available for listening.
As there is not functional API to connect with credentials I found the following bypass.
After downloading source code, parse html and look for links that start by "t4.bcbits".
Replace links album["tracks"]["url"] by the found link.

I will create a PR if I find time to clean my code

Have a great day

:)

@ArmSob
Copy link
Author

ArmSob commented Jan 19, 2024

Replace lines 83 to 88 by

            if lyrics:
                track['lyrics'] = self.get_track_lyrics(f"{artist_url}{track['title_link']}#lyrics")
            if track['file'] is not None:
                track = self.get_track_metadata(track)
                album['tracks'].append(track)
            else:
                html = open("/path/to/html_file.html")
                soup = BeautifulSoup(html, "html.parser")
                bandcamp_json_ = BandcampJSON(soup, debugging).generate()
                page_json_ = {}
                for entry_ in bandcamp_json_:
                    page_json_ = {**page_json_, **json.loads(entry_)}
                track["file"] = {'mp3-v0': page_json_["trackinfo"][i]['file']["mp3-v0"]}
                track = self.get_track_metadata(track)
                album['tracks'].append(track)

And replace /path/to/html_file.html by the path to your html file.
Be careful, links are temporary, so it is important to execute right after saving html file, or regenerate html file when needed.

@Evolution0
Copy link
Collaborator

I had an idea sometime back to add the ability to login and save the session data but I never got around to it as I don't own anything on bandcamp to test with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants