This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import time | |
# Function to make a GET request to the given URL with retries | |
def make_get_request_with_retry(url, params=None, max_retries=5, retry_delay=6): | |
for _ in range(max_retries): | |
try: | |
response = requests.get(url, params=params) | |
response.raise_for_status() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spotipy | |
from spotipy.oauth2 import SpotifyClientCredentials | |
sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id="XXXX", client_secret="XXXX")) | |
pl = sp.playlist('XXXX') | |
song_urls = [] | |
for x in pl['tracks']['items']: | |
song_url = x['track']['external_urls']['spotify'] | |
song_urls.append(song_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
FAILCTR=0 | |
# Check if a file argument is provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <url_list_file>" | |
exit 1 | |
fi | |
url_list_file="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([int]$minutes=60) # input param, 60 minutes if no value provided | |
$wsh = New-Object -ComObject WScript.Shell | |
$a = Get-Date # Current time | |
$b = $a.AddMinutes($minutes) # Target time | |
while ($a -lt $b) { | |
# Send Shift+F15 | |
$wsh.SendKeys('+{F15}') | |
Start-Sleep -seconds 240 # sleep for 4 minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i "http://.../index.m3u8" -c copy my_file.mkv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in "$@" | |
do | |
fdir="$(dirname "${f}")" | |
/usr/local/bin/7zz e "$f" -o"$fdir" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a virtual environment named env by convention | |
python3 -m venv env | |
# make sure to add env/ (or whatever you named your virtual environment) to your .gitignore file | |
# use the virtual environment | |
source env/bin/activate | |
# save dependencies to requirements.txt file | |
pip freeze > requirements.txt |