Python library to download your favorited tabs from Ultimate-Guitar.com.
- Favorites: Download all your liked tabs (requires cookies)
- Tab Content: Get individual tab content by URL
Search is broken. Cloudflare blocks automated searches pretty consistently. If you want to help fix this, PRs are welcome. For now, use the UG website to find tabs, favorite them, then use this to download.
pip install ultimate-guitar-scraperFor Cloudflare bypass support:
pip install ultimate-guitar-scraper[cloudflare]git clone https://github.com/yourusername/ug_api.git
cd ug_api
pip install -e .Get your cookies from browser DevTools (F12 → Application → Cookies → ultimate-guitar.com). You need SESSIONUG and bbsessionhash.
from ug_api import UGScraper
cookies = {
'SESSIONUG': 'your_session_cookie_here',
'bbsessionhash': 'your_bb_session_here'
}
scraper = UGScraper(cookies)
# Get your favorites
result = scraper.get_favorites()
for tab in result['favorites']:
print(f"{tab['artist']} - {tab['title']} ({tab['type']})")
print(f" URL: {tab['url']}")
# Download a specific tab
tab = scraper.get_tab("https://tabs.ultimate-guitar.com/tab/...")
if not tab['error']:
print(tab['content'])- Open Ultimate-Guitar.com in your browser
- Log in
- Press F12 to open DevTools
- Go to Application tab → Cookies → ultimate-guitar.com
- Copy the values for
SESSIONUGandbbsessionhash - Paste them into the cookies dict
Initialize with your UG session cookies.
Args:
cookies(dict): Your UG cookies including SESSIONUG and bbsessionhash
Get all your favorited tabs.
Returns:
{
'favorites': [
{
'title': 'Song Name',
'artist': 'Artist Name',
'type': 'Chords',
'url': 'https://...',
'liked_at': '2024-01-01'
}
],
'error': None
}Download tab content from a URL.
Returns:
{
'title': 'Song Name',
'artist': 'Artist Name',
'content': '...',
'url': 'https://...',
'error': None
}- No search: Cloudflare blocks search requests. Favorite tabs manually on the website first.
- Official tabs: Can't download official/licensed tabs
- Rate limiting: Use cookies to avoid getting blocked
Search functionality needs work. If you figure out a way around Cloudflare's bot detection, please submit a PR.
To publish this package:
# Install build tools
pip install build twine
# Build the package
python -m build
# Upload to PyPI (you'll need PyPI account credentials)
python -m twine upload dist/*For TestPyPI (testing):
python -m twine upload --repository testpypi dist/*AGPL-3.0-or-later - Educational use only. Respect UG's ToS.
If you find this useful: Support via PayPal