Skip to content

Instantly share code, notes, and snippets.

View spookyahell's full-sized avatar
🌐
Browsing the WWW (and helping others and myself get through life)

spookyahell

🌐
Browsing the WWW (and helping others and myself get through life)
View GitHub Profile
@spookyahell
spookyahell / NZBget_rpc.py
Last active December 19, 2018 22:46
Send new password to nzbget RPC by either account or servername
import requests
from sys import argv, exit as sexy_exit
#~ Script to update the password on a NZBget server by finding a very specific username
def setPassword(printX, serverURL = None, username = None, password = None, servername = None):
r = requests.post(serverURL, json = {'method':'loadconfig','params':[]})
if r.status_code != 200:
printX('Assuming auth misconfig')
@spookyahell
spookyahell / NineKWeu.py
Last active December 20, 2018 17:53
client object for 9kw.eu
from UA import firefox
from time import sleep
import requests
class nineKWclientException(Exception):
pass
class nineKWclient(object):
def __init__(self, APIKEY):
self.APIKEY = APIKEY
@spookyahell
spookyahell / piTunesClaimBatch.py
Last active December 25, 2018 10:09
python iTunes tool (batch claim) | Use at own risk | Modify the sections that obviously require editing
import requests
import configparser
s = requests.session()
from sys import exit
import argparse
parser = argparse.ArgumentParser(prog='piTunes',formatter_class=argparse.RawTextHelpFormatter, description='This python script is the work of @spookyahell.\n'+
@spookyahell
spookyahell / exe2version_info.py
Last active November 6, 2023 09:14
Using the python pefile lib to extract version information from an exe file
'''Licensed under the MIT License :)'''
import pefile
import pprint
pe = pefile.PE('example.exe')
string_version_info = {}
for fileinfo in pe.FileInfo[0]:
@spookyahell
spookyahell / pythonBackup.py
Created January 1, 2019 16:01
What better way to backup Python files (and related docs) then by a simple python script?
from os import listdir, sep
from os.path import isfile, isdir, join
import zipfile
import time
from sys import stdout
zip_filename = time.strftime('pythonBackup-%Y%m%d-%H%M%S.zip')
zf = zipfile.ZipFile(zip_filename,'w')
archive_these = {r'C:\Users\XYZ\Desktop\Python':'PythonFilesOnDesktop'}
@spookyahell
spookyahell / peinfo.py
Last active January 2, 2019 15:33
tracking exe version online (with ETag)
import pefile
import pprint
def get_version_info(file):
pe = pefile.PE(file)
string_version_info = {}
for fileinfo in pe.FileInfo[0]:
if fileinfo.Key.decode() == 'StringFileInfo':
@spookyahell
spookyahell / transfershTelegramBot.py
Last active January 7, 2019 22:56
Telegram bot for interacting with transfer.sh
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import CommandHandler, Updater, CallbackQueryHandler, Filters, MessageHandler
import os
import json
import logging
import requests
import re
from urllib.parse import unquote
'''Transfer.shBot operating on Telegram: @transfersh2bot
@spookyahell
spookyahell / ttml2srt3.py
Last active February 4, 2019 22:06
!!!Only for timcodes with frame expressions!!!
'''The simplest of all TTML to SRT subtitle converters, might not work in every case but it works for me'''
from xmltodict import parse
import json
def zfillseconds(input):
secondsP1, secondsP2 = input.split(',')
secondsP1 = secondsP1.zfill(2)
while len(secondsP2) != 3:
secondsP2 += '0'
@spookyahell
spookyahell / convert.py
Last active February 1, 2019 12:57
Convert a filename with spaces
import re
from copy import copy
def convertToDotted(stri):
output = ''
previous_char = None
for char in stri:
x = re.fullmatch(r'\w', char)
@spookyahell
spookyahell / internetCheck.py
Last active February 4, 2019 22:05
Check the internet connection reliably... firefox is faster due to transferring less data and as we know is also more safe... Google is maybe even more reliable (never seen detectportal down though either)
import requests
def CheckNet(source = 'F'):
sources = {'G':'https://www.google.com','F':'http://detectportal.firefox.com/success.txt'}
find_in_text = {'G':'maxlength="2048" name="q"','F':'success'}
if source in sources:
src = sources[source]
else:
raise NotImplementedError('Source unavailable')
try: