noahmaranesi / Ultimate-Guitar-Hack

The first tool to download any Guitar Pro file, including 'Official' from Ultimate Guitar
87 stars 10 forks source link

Simpler method via bookmarklet #2

Closed gerardbalaoro closed 2 years ago

gerardbalaoro commented 3 years ago

I discovered that the form already exists in the page but it is hidden so this can be done by simply opening the Developer Console and running the code below.

document.querySelector('[action="https://tabs.ultimate-guitar.com/tab/download"]').submit()

You can do this easily by converting the script into a bookmarklet

javascript:(function()%7Bdocument.querySelector('%5Baction%3D%22https%3A%2F%2Ftabs.ultimate-guitar.com%2Ftab%2Fdownload%22%5D').submit()%7D)()%3B

Tried it in incognito and it worked.

noahmaranesi commented 3 years ago

What did you download when trying this ('Official' tabs, blocked/removed tabs, user-submitted tabs)? My method no longer works and your javascript bookmarklet sends me back an error... 😔

gerardbalaoro commented 3 years ago

@noahmaranesi that's too bad. I just noticed this now. But I think you can still use this to download regular tabs. Or download official tabs when you have pro.

I turned your original method into a bookmarklet so people don't have to copy and paste or open the Developer tools.

javascript:(function()%7B(function() %7B%0A%09var form %3D '<form id%3D"download-gpx" style%3D"display%3A none%3B"action%3D"https%3A%2F%2Ftabs.ultimate-guitar.com%2Ftab%2Fdownload"><input type%3D"hidden" name%3D"id" value%3D"_TAB_ID_HERE_"><button><span>Download Guitar Pro File<%2Fspan><%2Fbutton><%2Fform>'%3B%0A%09var tabURL %3D window.location.pathname%3B%0A%09var tabID %3D tabURL.slice(tabURL.lastIndexOf('-') %2B 1)%3B%0A%0A%09document.querySelector('body').insertAdjacentHTML("beforebegin"%2C form.replace('_TAB_ID_HERE_'%2C tabID))%3B%0A%09document.querySelector('%23download-gpx').submit()%3B%0A%09document.querySelector('%23download-gpx').remove()%3B%0A%7D)()%3B%7D)()%3B
noahmaranesi commented 3 years ago

@GerardBalaoro that's great! I am able to download 'Official' tabs with this; no longer download removed/blocked tabs. I think Ultimate Guitar might of just completely removed our/user permission to view since you can't natively view it on the site anyway.

Fmaj9 commented 3 years ago

@noahmaranesi that's too bad. I just noticed this now. But I think you can still use this to download regular tabs. Or download official tabs when you have pro.

I turned your original method into a bookmarklet so people don't have to copy and paste or open the Developer tools.

javascript:(function()%7B(function() %7B%0A%09var form %3D '<form id%3D"download-gpx" style%3D"display%3A none%3B"action%3D"https%3A%2F%2Ftabs.ultimate-guitar.com%2Ftab%2Fdownload"><input type%3D"hidden" name%3D"id" value%3D"_TAB_ID_HERE_"><button><span>Download Guitar Pro File<%2Fspan><%2Fbutton><%2Fform>'%3B%0A%09var tabURL %3D window.location.pathname%3B%0A%09var tabID %3D tabURL.slice(tabURL.lastIndexOf('-') %2B 1)%3B%0A%0A%09document.querySelector('body').insertAdjacentHTML("beforebegin"%2C form.replace('_TAB_ID_HERE_'%2C tabID))%3B%0A%09document.querySelector('%23download-gpx').submit()%3B%0A%09document.querySelector('%23download-gpx').remove()%3B%0A%7D)()%3B%7D)()%3B

How do you get this to work @GerardBalaoro ? I'm not that great at this stuff but I'm to trying to download an official tab, I have ultimate guitar pro, but I'm not sure how a bookmarklet works?

Fmaj9 commented 3 years ago

I figured it out. I apologize for my ignorance. Thank you!

Plutoshin commented 1 year ago

I figured it out. I apologize for my ignorance. Thank you!

Hi, can you tell me how you did it? I open developer options and enter the code, but an error appears