Skip to content

Instantly share code, notes, and snippets.

View chrippa's full-sized avatar

Christopher Rosell chrippa

View GitHub Profile
@chrippa
chrippa / ls_hook.lua
Last active August 29, 2015 14:11 — forked from ChrisK2/ls_hook.lua
local utils = require 'mp.utils'
local msg = require 'mp.msg'
local ls = {
path = "livestreamer",
}
mp.add_hook("on_load", 9, function()
local url = mp.get_property("stream-open-filename")
#!/bin/sh
URL=$1
CHANNELS=$(echo $URL | sed -e 's/http:\/\/multitwitch.tv\///g')
IFS="/"
for CHANNEL in $CHANNELS; do
livestreamer twitch.tv/$CHANNEL best &
done
#!/usr/bin/env python
import sys
from livestreamer.packages import flashmedia
if len(sys.argv) < 3:
sys.exit("Usage: {0} <infile> <outfile>".format(sys.argv[0]))
infile = open(sys.argv[1], "rb")
outfile = open(sys.argv[2], "wb")
flv = flashmedia.FLV(infile)
@chrippa
chrippa / gist:7402186
Created November 10, 2013 18:50
livestream.com test
import librtmp
channel = "tv_zenica_live"
url = "rtmp://x" + channel + "x.e.channel.livestream.com/mogulus-edge/" + channel
data = ["player", None, "instance390", "", None, {}, "password", 197377, True]
conn = librtmp.RTMP(url, connect_data=data, app="mogulus-edge/" + channel)
status = conn.connect().result()
@chrippa
chrippa / blizzcon.py
Created November 8, 2013 02:15
Livestreamer plugin for Blizzcon esport streams, valid urls: blizzcon://sc2 blizzcon://wow blizzcon://esports
from livestreamer.plugin import Plugin
from livestreamer.stream import HTTPStream
from livestreamer.utils import urlget, parse_json, res_xml
import re
CHANNELS = {
"sc2": ["blizzcon2013_scii_d1_ah_l",
"blizzcon2013_scii_d1_ah_m",
"blizzcon2013_scii_d1_ah_h"],
@chrippa
chrippa / twitchdl.sh
Last active December 20, 2015 15:09
#!/bin/sh
CHANNEL=$1
while true; do
OUTPUT="./$CHANNEL-$(date +%Y-%m-%d).flv"
if [ -f $OUTPUT ]; then
for i in `seq 1 99`; do
filename="$OUTPUT.$i"
var xmmsclient = require('xmmsclient'),
util = require('util')
var client = new xmmsclient.Client('blackcat');
client.onconnect = function () {
console.log("Connected!")
client.playback.broadcast_current_id().onvalue = function (id) {
client.medialib.get_info(id).onvalue = function (propdict) {
metadata = xmmsclient.PropDict.flatten(propdict)
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py
index a60b184..d0148dd 100644
--- a/src/livestreamer/cli.py
+++ b/src/livestreamer/cli.py
@@ -310,9 +310,21 @@ def handle_url(args):
if len(streams) == 0:
exit("No streams found on this URL: {0}", args.url)
- keys = list(streams.keys())
- keys.sort()
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py
index a30b58f..a60b184 100644
--- a/src/livestreamer/cli.py
+++ b/src/livestreamer/cli.py
@@ -62,6 +62,8 @@ outputopt.add_argument("-O", "--stdout", action="store_true",
streamopt = parser.add_argument_group("stream options")
streamopt.add_argument("-c", "--cmdline", action="store_true",
help="Print command-line used internally to play stream, this may not be available on all streams")
+streamopt.add_argument("--repr", action="store_true",
+ help="Print internal representation of the stream, useful for external programs that wants access to internal parameters")
// mounts
{
"by-name": {
{ "query": "pkey.BeginsWith(set:anidb:anime)", "display": "$romaji [$eps]" }
{ "query": "pkey.BeginsWith(file:), anime.Equals($prev[1].pkey)", "display": "$anime_romaji - $ep_number [$group_name].$ext" }
},
"by-group": {
{ "query": "pkey.BeginsWith(set:anidb:group)", "display": "$name" },
{ "query": "pkey.BeginsWith(file:), group.Equals($prev[1].pkey)", "groupby": "anime", "display": "$romaji" },