Script to automatically download a youtuber's live stream as soon as it becomes live. It also respects youtube's free API limitations.
This lightweight shell script demonstrates running two commands in parallel while combining their outputs into a single stdout. The script also prepends a static string to differentiate the output of each command. This solution requires zero external dependencies, making it efficient and easy to use.
run.sh
#!/bin/bash
# replace command1 and command2 with command you need to execute
- Open your terminal
- Install brew if it is not installed: https://brew.sh/
- Install jq by running the following command
brew install jq
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 PyPDF2 | |
input_pdf = PyPDF2.PdfFileReader(open("document.pdf", "rb")) | |
num_of_pages_per_file = 10 | |
doc_counter = 1 | |
counter = 0 | |
output = PyPDF2.PdfFileWriter() | |
for split_range in [range(input_pdf.numPages)[x:x + num_of_pages_per_file] for x in | |
range(0, input_pdf.numPages, num_of_pages_per_file)]: |
I hereby claim:
- I am gautamkrishnar on github.
- I am gkrish (https://keybase.io/gkrish) on keybase.
- I have a public key ASA7kdEWVJClHLW8EkVu1aRXGE9Ldn6JuZOrPHEAbpS7CQo
To claim this, I am signing this object:
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 threading | |
import os | |
import random | |
pastebinurl = "https://pastebin.com/u/gautamkrishnar" | |
def loaduseragents(): | |
""" | |
Loads the list of user agents from user_agents.txt | |
:return: | |
""" |
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 threading | |
x=0 #to get a random number | |
killswitch = False # To kill thread after use | |
def threaded_return(que): | |
""" | |
Returning data from thread safely (Returns current value of x) | |
:param que: | |
:return: | |
""" | |
global x |
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 multiprocessing as mp | |
process_list = [] | |
def pr1(test,test1): | |
""" | |
@:param: test,test1 (Integer) | |
process 1 | |
""" | |
print("Pr 1 prining... '"+str(test)+"','"+str(test1)+"' recieved...") |
NewerOlder