Skip to content

Instantly share code, notes, and snippets.

View deependujha's full-sized avatar
😇
Just do the work. Don't expect anything.

Deependu deependujha

😇
Just do the work. Don't expect anything.
View GitHub Profile
// paste in youtube's subscription page's console
async function unsubscribeAll() {
const subscribedButtons = Array.from(document.querySelectorAll('button'))
.filter(btn => btn.innerText.trim() === 'Subscribed');
console.log(`Found ${subscribedButtons.length} subscribed channels.`);
for (let i = 0; i < subscribedButtons.length; i++) {
subscribedButtons[i].click();
# code taken from: https://github.com/jonasehrlich/chrometrace/blob/main/chrometrace/chrometrace.py#L555
"""
idea: open file, and write "["
from then on, when dumping a list of dict to json, remove first and last character as they will be "[" & "]".
Also append ", " to the end for next iteration.
on end, remove the last 2 bytes (since ", " was added) and write "]"
"""
class _TraceWriter: