Skip to content

Instantly share code, notes, and snippets.

@project237
project237 / get_youtube_playlist_json.js
Last active February 17, 2023 17:57
Get a list of video metadata of any public or private youtube playlist (title, id, time left, channel, url) as a json file
// Modifier: user237
// Forked from: https://gist.github.com/silver-mixer/43009c048a5e7e60f2182198ad0a105b
// Description: To download a list of video metadata of any public or private youtube playlist, as a json document, run this script on the playlist page.
// date created: 2023-09-02
(() => {
const VERSION = "user237_v1";
const REGEX_LIST_ID = /\?list=([a-zA-Z0-9-_]+)($|&)/;
const REGEX_TIMELEFT = /t=([0-9]+)/; // get the first capture group using [1]
@project237
project237 / temp1.py
Created November 27, 2022 14:42
temp1
from bs4 import BeautifulSoup
import requests
from pprint import pprint
import time
from cnd_login import KEY, USERNAME, COOKIE, HEADERS
BASE_URL = "edge.cindicator.com"
TARGET_URL = "https://edge.cindicator.com/indicators"
LOGIN_URL = "https://edge.cindicator.com/login"
OUTPUT_FILENAME = "cnd_indicators.html"
@project237
project237 / requests_change_user_agent.py
Created October 21, 2022 11:31
Change the requests module user agent to a specified user agent string.
import requests as req
NEW_AGENT = "USER_AGENT_HERE"
def change_user_agent(new_agent):
req.utils.default_user_agent = lambda: new_agent
def get_user_agent():
url = 'https://httpbin.org/user-agent'
response = req.get(url)