Skip to content

Instantly share code, notes, and snippets.

import requests
from bs4 import BeautifulSoup
import json
import time
def scrape_oscars(url):
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Encoding": "gzip, deflate, br, zstd",
@preraku
preraku / playlist_preview_urls.py
Created December 29, 2021 05:19
Get Spotify track preview URLs from Spotify playlists
import base64
import requests
GET_NEW_ACCESS_TOKEN = False
if GET_NEW_ACCESS_TOKEN:
# Create and send an authorization request to Spotify
client_id = 'CLIENT_ID'
client_secret = 'CLIENT_SECRET'
auth_url = 'https://accounts.spotify.com/api/token'