Skip to content

Instantly share code, notes, and snippets.

View m4p's full-sized avatar

Martin Pittenauer m4p

View GitHub Profile
@m4p
m4p / twitch-downloader
Last active August 29, 2015 13:58
A bash script to download a twitch archive broadcast by its id number. needs axel and ffmpeg.
#!/bin/bash
ID=$1
DATA="$(curl -silent http://api.justin.tv/api/broadcast/by_archive/$ID.xml?onsite=true)"
URLs="$(echo $DATA | grep -io 'http.*\.flv')"
NAME="$(echo $DATA | grep '<title>' | head -n1 | sed 's/<title>//g' | sed 's/<\/title>//g' | sed 's/^ *//g' | sed 's/ /\./g'| sed 's/\///g'|sed s/\'//g)"
mkdir "$NAME"
cd "$NAME"

Keybase proof

I hereby claim:

  • I am m4p on github.
  • I am map (https://keybase.io/map) on keybase.
  • I have a public key whose fingerprint is A29C 1DC3 42BC 4B0F 20AD B653 8A14 3302 7195 C1BE

To claim this, I am signing this object:

@m4p
m4p / gist:7613124
Created November 23, 2013 10:44
All 155+ hours of Desert Bus 7 in a convenient URL list. For you favorite download manager or to 'wget -ci'.
http://store21.media21.justin.tv/archives/2013-11-14/live_user_desertbus_1384400271.flv
http://store51.media10.justin.tv/archives/2013-11-14/live_user_desertbus_1384402072.flv
http://store25.media25.justin.tv/archives/2013-11-15/live_user_desertbus_1384494278.flv
http://store34.media34.justin.tv/archives/2013-11-16/live_user_desertbus_1384569100.flv
http://store66.media55.justin.tv/archives/2013-11-16/live_user_desertbus_1384570902.flv
http://store76.media59.justin.tv/archives/2013-11-16/live_user_desertbus_1384572702.flv
http://store34.media34.justin.tv/archives/2013-11-16/live_user_desertbus_1384574506.flv
http://store58.media12.justin.tv/archives/2013-11-16/live_user_desertbus_1384624116.flv
http://store59.media52.justin.tv/archives/2013-11-16/live_user_desertbus_1384625919.flv
http://store23.media23.justin.tv/archives/2013-11-16/live_user_desertbus_1384627727.flv
@m4p
m4p / where.php
Created July 14, 2013 10:30
Backend for map.af/api.location
#!/usr/bin/php
<?PHP
require '/var/www/offsite/class.sosumi.php';
header('Content-Type: application/json');
$file = '/var/www/offsite/location.cache';
if (time() - filemtime($file) > 5*60) {
from lxml import etree
from copy import deepcopy
from math import ceil
itemsPerPage = 10
for inFile in ["episodes.all.m4a.rss", "episodes.all.mp3.rss"]:
xmlData = etree.parse(inFile)
@m4p
m4p / SyntaxDefinition.xml
Created June 18, 2013 13:57
SubEthaEdit Base.mode with file:// URIs. (see line 26)
<?xml version="1.0" encoding="UTF-8"?>
<syntax>
<head>
<name>Default</name> <!-- The definitions title -->
<autocompleteoptions use-spelling-dictionary="yes" />
<charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@]]></charsintokens> <!-- Valid Characters for Variables -->
</head>
<states>
@m4p
m4p / gist:5435295
Created April 22, 2013 13:53
shutup.py
#!/usr/bin/python
import cgi
import urllib2
import re
import cgi
fs = cgi.FieldStorage()
url = fs['url'].value
print "Content-type: text/html"