Skip to content

Instantly share code, notes, and snippets.

@hannsen
hannsen / lookmovie2_dl.py
Created August 24, 2024 22:46
lookmovie2 downloader, copy ts stream url from network tab
import re
import os
import urllib.request
from urllib.error import HTTPError
linki = '''
https://acdcn01.mugaznik.bond/aes/example.mp4/seg-7-v1-a1.ts
'''.strip()
@hannsen
hannsen / srt_translate_deepl_selenium.py
Created August 4, 2024 19:11
Translate srt file with deepl web ui using selenium
# Make imports
import time
from random import randint
from tkinter import Tk
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as e_c
from selenium.common.exceptions import ElementClickInterceptedException
@hannsen
hannsen / zdf_xml_to_srt.py
Created March 22, 2023 12:35
ZDF Mediathek Subtitle XML to SRT converter
import xml.etree.ElementTree as ET
# Parse the XML file
tree = ET.parse('in.xml')
root = tree.getroot()
f = open("out.srt", "a")
# Find and print every tt:p tag
i = 0
@hannsen
hannsen / Drupal Cheat Sheet
Created February 24, 2020 09:10
Drupal Cheat Sheet
all cardinality unlimited fields: entity->field->getValue()
all referenced entites: entity->field->referencedEntities()
one referenced entity: entity->field->entity
value of field: entity->field->value
entity reference id of field: entity->field->target_id
load entity by id: Entity::load(id)
load multiple entites by id: Entity::loadMultiple([ids])
clear cache: \Drupal::service('page_cache_kill_switch')->trigger();
get tabellen name of entity: ->getEntityType()->getDataTable()