Skip to content

Instantly share code, notes, and snippets.

View rebane2001's full-sized avatar
🦊

Lyra Rebane rebane2001

🦊
View GitHub Profile
@rebane2001
rebane2001 / bilibiliextract.py
Created June 2, 2021 10:06
Simple script to extract bilibili video IDs/URLs from a channel ID/URL
# Simple script to extract all video IDs from a bilibili channel
# Not properly cleaned up for public release, so you're on your own
import requests
import json
import re
def getChannelPageVideos(channelid,page):
print("Getting page",page)
headers = {
'authority': 'api.bilibili.com',
Archive what you'll never see twice
Whatever you did years ago, it changed you. For the better, and that's nothing you can throw away, delete, or unlist.
(from https://flowny.bandcamp.com/track/stand-alone-by-combine-feat-feather)
The reality is that things you want will disappear and things you don’t will be around for forever.
(from https://www.bbc.com/future/article/20210715-the-online-data-thats-being-deleted)
@rebane2001
rebane2001 / patch.py
Last active July 6, 2021 11:11
matterport-dl expiration patch
import re
import os.path
for p in ["showcase.js","js/showcase.js"]:
if os.path.isfile(p):
with open(p,"r",encoding="UTF-8") as f:
j = f.read()
with open(p,"w",encoding="UTF-8") as f:
f.write(re.sub(r"\&\&\(!e.expires\|\|.{1,10}\*e.expires>Date.now\(\)\)","",j))
print("Patched!")
@rebane2001
rebane2001 / daily_metadata.py
Created July 17, 2021 19:56
Somewhat hastily written script to pull metadata for every video in an archive (recommended to cronjob to every day)
import requests
import re
import os
import time
import json
from datetime import datetime, timezone
import random
# Put your YouTube API keys here, the more the merrier (one key can do 500k vids a day)
youtube_api_keys = ["YOUR_API_KEYS_HERE"]
// ==UserScript==
// @name Search Hobune for unavailable video IDs
// @namespace hobune.stream
// @match https://www.youtube.com/watch
// @grant GM_xmlhttpRequest
// @connect hobune.stream
// @version 1.1
// @author Rebane
// @description 10/31/2020, 3:47:50 PM
// ==/UserScript==
#!/usr/bin/env python3
import requests
import re
import os
import time
import json
from datetime import datetime, timezone
import random
@rebane2001
rebane2001 / dropbox-folder-batch-download.js
Last active June 8, 2022 16:40
Automatically downloads every Dropbox subfolder (and file) as a zip file.
/*
Sometimes, Dropbox folders are too huge and attempting to download them as zip results in the "The zip file is too large." error.
This script automatically downloads every subfolder (and file) as a zip file to work around this issue.
To use it, just open the Console (F12) on the Dropbox page, paste this script in, and run it.
*/
document.querySelectorAll("a").forEach(e => {
if (e.href.includes("dl=0")){
window.open(e.href.replace("dl=0","dl=1"));
}
})
@rebane2001
rebane2001 / discord-pin-compressor.html
Last active September 18, 2023 10:14
This is a simple app that converts Discord pins to Discord messages, which is useful for example when you've reached the pin limit and wish to have more room for new pins.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Pin Compressor</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Pin Compressor">
<meta name="author" content="rebane2001">
<style>
/*
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*
@rebane2001
rebane2001 / search_hobune_for_all.js
Created September 26, 2022 13:51
Old version, still works but has some glitches
// ==UserScript==
// @name Search Hobune for all videos on page
// @namespace hobune.stream
// @match https://www.youtube.com/*
// @grant GM_xmlhttpRequest
// @connect hobune.stream
// @version 1.0
// @author Rebane
// @description 1/8/2021, 12:02:22 PM
// ==/UserScript==