Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Prem-ium committed Jan 7, 2024
2 parents 2495dec + 47129ad commit 7f5d52b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 33 deletions.
8 changes: 0 additions & 8 deletions DockerQuick.bat

This file was deleted.

49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ To run this project, you will need to add the following environment variables to
| `GSPREAD_KEYS` | Your Google Service Account JSON contents obtained via OAuth 2.0 Client ID in Credentials of Google Cloud API. | - |



## Setup
#### Spotify Developer Credentials (Required)
1. Head over to [Spotify Developer's Dashboard](https://developer.spotify.com/dashboard/). Login or create an account using your Spotify.
Expand All @@ -50,15 +51,7 @@ To run this project, you will need to add the following environment variables to
5. Copy/paste Client ID into `CLIENT_ID` and Secret Client ID into `SECRET_CLIENT_ID` within your .env file.
<img src="https://user-images.githubusercontent.com/80719066/202246004-f7307806-69ec-4489-975b-beb71e6637b3.png" style="width: 50%;"></img>

### GitHub Actions
1. Fork the repository and start configuring your `.env` by navigating to your Forked Repository Settings: `Settings -> Security -> Secrets & Variables -> Actions -> New Repository Secret`.
3. Enable `GITHUB_ACTIONS` by assigning the value of `True` within your `.env`.
4. Run `main.py`, click the URL in the console, and approve the ticket for your account.
5. Copy the URL after approving permissions, paste it into the console, and hit enter.
6. Copy the cache JSON contents and assign it to the `AUTH_CACHE` variable within GitHub Secrets.
7. Adjust the cron job if necessary.

### Google Sheets/GSpread (Optional)
#### Google Sheets/GSpread (Optional)
1. Sign into [Google Cloud Console](https://console.cloud.google.com/), create your APP,Enable Google Sheets and Google Drive APIs.
3. Head to API & Services -> Credentials -> Create Credentials -> Service Account. Go through the prompts & download the JSON file afterwards.
5. Open Google Sheets and create a new file named 'Wrapped365'. Add tabs named 'short_term', 'medium_term', 'long_term', 'short_term Artists', 'medium_term Artists', and 'long_term Artists'
Expand Down Expand Up @@ -91,26 +84,46 @@ Finally, you're ready to run the script!
docker run -it --env-file ./.env --restart unless-stopped --name spotify-wrapped spotify-wrapped
```


5. Let the bot log in and begin working. DO NOT PRESS `CTRL-c`. This will kill the container and the bot. To exit the logs view, press `CTRL-p` then `CTRL-q`. This will exit the logs view but let the bot keep running.


## License

This repository is using the [MIT](https://choosealicense.com/licenses/mit/) license.


## 🎧 What I've been listening to

[<img src="covers/short_term.jpg" style="width:30%;height:30%;">](https://open.spotify.com/playlist/41FgHkzQ2wf4v8MtoITL77?si=c4c016d8bdbf411a) [<img src="covers/medium_term.jpg" style="width:30%;height:30%;">](https://open.spotify.com/playlist/657cuGMmf1CnJEeMhfwgnK?si=154abf33ddd64a20) [<img src="covers/long_term.jpg" style="width:30%;height:30%;">](https://open.spotify.com/playlist/42TRuidms91LuMajAIu5xI?si=8a22e2ccb6b9445f)

## Donations
I've been working on this project for a few months now, and I'm really happy with how it's turned out. It's also been a helpful tool for users to earn some extra money with Bing Rewards. I'm currently working on adding new features to the script and working on other similar programs to generate passive income. I'm also working on making the script more user-friendly and accessible to a wider audience.
If you appreciate my work and would like to show your support, there are two convenient ways to make a donation:

1. **GitHub Sponsors**
- [Donate via GitHub Sponsors](https://github.com/sponsors/Prem-ium)
- This is the preferred donation method as you can place donations with no transaction fees & possibily receive perks for your donation.
- [![GitHub Sponsor](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/Prem-ium)
I'm accepting donations through BuyMeCoffee or GitHub Sponsors. Any amount you can donate will be greatly appreciated.

<div style="display: grid; grid-template-columns: 1fr 1fr; justify-content: center; gap: 10px;">
<div style="display: grid; justify-content: center;">
<span>Buy Me a Coffee:</span>
<a href="https://www.buymeacoffee.com/prem.ium" target="_blank">
<img src="https://raw.githubusercontent.com/Prem-ium/youtube-analytics-bot/main/output-examples/media/coffee-logo.png" alt="Buy Me A Coffee" style="height: 41px !important; width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important; -webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;">
</a>
</div>
<div style="display: grid; justify-content: center;">
<span>GitHub Sponsors:</span>
<a href="https://github.com/sponsors/Prem-ium" target="_blank">
<img src="https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA" alt="GitHub Sponsor" style="height: 41px !important; width: 174px !important; box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important; -webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;">
</a>
</div>
</div>

Your donations will help me to cover the costs of hosting the project, developing new features, and marketing the project to a wider audience.
Thank you for your support!


## Final Remarks
How to Get Spotify Wrapped. 365 days a year. While everyone else google searches 'how to see / check / find spotify wrapped' you'll have access to your top played tracks and artists all year long!

2. **Buy Me A Coffee**
- [Donate via Buy Me A Coffee](https://www.buymeacoffee.com/prem.ium)
- [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/prem.ium)
As previously mentioned however, I strongly recommend utilizing this repository using a service such as [Replit](https://replit.com/) & [UpTimeRobot](https://uptimerobot.com/) as they will allow you the program to run without any computer resource cost to you.

Your generous donations will go a long way in helping me cover the expenses associated with developing new features and promoting the project to a wider audience. I extend my heartfelt gratitude to all those who have already contributed. Thank you for your support!
Beyond that, thank you for your interest in this repository. Please leave a 🌟 & share with your friends!
19 changes: 12 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

# Spotify Credentials
if not os.environ["CLIENT_ID"] or not os.environ["SECRET_CLIENT_ID"] or not os.environ["REDIRECT_URL"] or not os.environ["USERNAME"]:
raise Exception("Variables are missing within the .env file. Please ensure you have CLIENT_ID, SECRET_CLIENT_ID, REDIRECT_URL, and USERNAME set.")
raise Exception(
"Variables are missing within the .env file. Please ensure you have CLIENT_ID, SECRET_CLIENT_ID, REDIRECT_URL, and USERNAME set.")
else:
# Update with your own Spotify Credentials (Client ID, Secret Client ID, redirect, and username)
SPOTIPY_CLIENT = os.environ['CLIENT_ID']
Expand Down Expand Up @@ -74,7 +75,7 @@
redirect_uri=SPOTIPY_REDIRECT, scope=SCOPE, username=USERNAME, open_browser=False))

USER_ID = SP.current_user()['id']

# Whether to use keep_alive.py
if (os.environ.get("KEEP_ALIVE", "false").lower() == "true"):
from keep_alive import keep_alive
Expand Down Expand Up @@ -293,13 +294,17 @@ def main():
try:
Wrapped()
print(f'\n{"-"*88}\n{f"{info}".center(88)}\n{"-"*88}\n')
if not GITHUB_ACTIONS: time.sleep(WAIT)
else: break
time.sleep(WAIT)

except Exception as e:
print(f'Exception:\n {e} \n {traceback.format_exc()} \n\n')
if APPRISE_ALERTS: alerts.notify(title=f'Wrapped365 Exception.', body=f'{e}\nAttempting to restart in 15 minutes...')
print(f'\Exception:\n{e}\n\n{traceback.format_exc()}\n\n')
if APPRISE_ALERTS:
alerts.notify(title=f'Wrapped365 Exception.',
body=f'{e}\nAttempting to restart in 15 minutes...')
time.sleep(900)

continue


if __name__ == '__main__':
if APPRISE_ALERTS:
alerts = apprise_init()
Expand Down

0 comments on commit 7f5d52b

Please sign in to comment.