youtube-dl, or living without flash

For the past year, I've been living without Adobe Flash Player, meaning I could not watch videos/play music on most sites or use some web applications, that still use it. This was due to several reasons:

And what can I say, I don't miss it, thanks to youtube-dl (I find the project name a bit misleading (although Youtube has the most support) and a new user might simply overlook all the power he/she is given.), a small commandline application that is capable of downloading videos from Youtube and more than 300 other sites (the list is constantly growing). youtube-dl provides the URL of the video/stream, so you can play the video without downloading to (if your player supports it).

Being a CLI application, youtube-dl allows you to intergrate it into scripts, bash aliases and with other applications. For example, I wrote this little script to play the video in the current website (if there is a video, and the URL/website is supported by youtube-dl) by simply typing mpv in dwb (mpv is also the player I use, check it out):

//!javascript 
// play YouTube and other videos with mpv.

function playInMpv() {
    system.spawn("sh -c 'youtube-dl -g \"" + tabs.current.uri + "\" | mpv -playlist -' &"); 
}

bind("mpv", playInMpv, "play_in_mpv");

If your favorite website is not supported, you can file an issue for it to be added, or, if you know some Python, try to implement it yourself. The hardest parts of doing that are reverse engineering the method the website in question uses to hide (if it does so) the video URL from the user and writing reliable regular expressions, which are used to extract information from the website (if you, like me, are not a Regex guru). There are full developer instructions on youtube-dl's GitHub page. I also recommend reading this tutorial by Filippo Valsorda, which also shows how to reverse engineer a video website.

So, if you have an urge to say goodbye to the Adobe Flash Player, go on and do so, abandon the sinking ship and join the Fight!.

Note: If you do try youtube-dl, be sure to compare your CPU usage when streaming the same video in your media player and using flash!

PyCon US 2014

Here are some interesting talks from PyCon US 2014, that are worth to watch.

All Your Ducks In A Row: Data Structures in the Standard Library and Beyond

by Brandon Rhodes

Why are Python programmers crazy about lists and dictionaries, when other languages tout bitmaps, linked lists, and B+ trees? Are we missing out? Come learn how data structures are implemented on bare metal, how to select the right data structure, how the list and dictionary cover a wide swath of use cases, and when to dip into the Standard Library or a third-party package for an alternative.

Refresh your knowledge about Python's data structures, and when to (not) use which.

Watch on Youtube

Building and breaking a Python sandbox

by Jessica McKellar

What does it take to make a Python sandbox that can run untrusted code? Learn some surprising language features and experience security challenges first-hand as we work through building a Python sandbox from scratch. You'll leave this talk with renewed appreciation for the dynamic nature of Python, some sneaky language tricks, and a solid background in classes of sandboxing security issues.

Hacking Python itself through introspection.

Watch on Youtube

Generators: The Final Frontier

by David Beazley

Python generators have long been useful for solving all sorts of problems involving iteration and data flow. However, one of their more powerful uses is in customizing various aspects of program control flow. In this tutorial, we'll look at some more exotic uses of generators such as writing context managers, inlining callback functions, eliminating recursion, implementing actors, and more.

All I knew about generators was ~5% of what there is to know.

Watch on Youtube

More to come (maybe). Full list of PyCon US 2014 available here.

Heartbleed Lithuania

Let's scrape the Internet and check some 5887 Lithuanian websites for the Heartbleed bug. The vulnerable:

100x100.lt
311.lt
78.lt
abaldai.lt
adrem.lt
adverus.lt
alna.lt
ambergift.lt
angelpine.lt
anno1777.lt
antstolis.lt
apini.lt
apleisti.lt
apstatyba.lt
apva.lt
arnesima.lt
artisok.lt
asimesta.lt
autoplius.lt
avitela.lt
baldai1.lt
baltai.lt
beststyle.lt
blogas.avitela.lt
bogfran.lt
brandshop.lt
cr.etaplius.lt
creator.lt
cstops.lt
delmodo.lt
demo.timebase.lt
desinieji.lt
digma.lt
div.lt
donelaitis.vdu.lt
drumclub.lt
e-ducate.lt
ecatalog.lt
elona.lt
emsi.lt
en.auto.plius.lt
erotas.lt
eshop.digma.lt
etnokultura.lt
eurocash1.lt
eurotrade1.lt
evertink.lt
f1pica.lt
fibex.lt
fotelier.lt
fotokuku.lt
fun2go.lt
gameris.lt
gerosnaujienos.lt
globalclub.lt
gm1.lt
gusto.lt
hcvilnius.lt
ievosnuomone.lt
ikgrupe.lt
infotv.lt
ipsun.lt
isic.lt
italia.lt
itgroup.lt
joa.lt
justitia.lt
kauko.lt
ketonline.lt
klepsydra.lt
konkursai.seku.lt
kovo3.lt
krekenavos.lt
lasai.lt
lemodus.lt
lietuvai.lt
limis.lt
liuksprekes.lt
liukstv.lt
livecraft.lt
lolturnyrai.lt
lrkt.lt
lstg.lt
lzinios.lt
mail.beststyle.lt
mail.lmb.lt
maja.lt
manogydytojas.lt
miglera.lt
mix-fm.lt
mokslobaze.lt
mp3doze.lt
mp3ty.lt
naneta.lt
narkaus.lt
ndma.lt
nemelas.lt
newisnew.lt
newyorkclub.lt
noriunoriunoriu.lt
norvegu24.lt
novel.lt
nreklama.lt
nskelbimai.lt
omniteksas.lt
onefuzz.lt
onyx.lt
paramedikas.lt
partyinbox.lt
patiekalai.lt
pick.lt
pijus.lt
plius.lt
powermotors.lt
project.mtop.lt
puikikaina.lt
pvkc.lt
radikaliai.lt
rank.wu.lt
rebuild.lt
reprodukcijos.lt
rezidencija.lt
roll.lt
ru.auto.plius.lt
rubik.lt
sadiva.lt
sagauta.lt
samp.kiberzona.lt
sanveda.lt
seku.lt
sender.lt
shopspy.lt
simtek.lt
skin.lt
smx.viko.lt
spauda.avitela.lt
spdizainas.lt
sportspa.lt
stats.kiberzona.lt
studija4d.lt
studio4d.lt
superfanas.lt
sveikinam.lt
taverne.lt
tepalita.lt
thesimple.lt
timebase.lt
traklama.lt
undp.lt
v1.lt
valdorfo.lt
vending.lt
verpstas.lt
videoboss.lt
virtual.lt
visainfo.lt
vrk.lt
web.lva.lt
worapay.lt
www2.isic.lt
x1.joa.lt
xd.lt
zaisliukas.lt
zalos.lt
zidiniugausa.lt
ziurim.lt

Is your site vulnerable? You can check here.

Update (2014-04-15):

Since posting, these sites have fixed the Heartbleed bug.

ambergift.lt
angelpine.lt
apini.lt
autoplius.lt
beststyle.lt
creator.lt
demo.timebase.lt
ecatalog.lt
en.auto.plius.lt
etnokultura.lt
gm1.lt
isic.lt
joa.lt
krekenavos.lt
liuksprekes.lt
livecraft.lt
lrkt.lt
lstg.lt
mail.beststyle.lt
maja.lt
mix-fm.lt
mp3ty.lt
noriunoriunoriu.lt
nreklama.lt
onefuzz.lt
pick.lt
plius.lt
project.mtop.lt
rank.wu.lt
rezidencija.lt
roll.lt
ru.auto.plius.lt
sender.lt
shopspy.lt
smx.viko.lt
spdizainas.lt
studija4d.lt
studio4d.lt
sveikinam.lt
timebase.lt
traklama.lt
videoboss.lt
web.lva.lt
worapay.lt
www2.isic.lt
x1.joa.lt
xd.lt
zaisliukas.lt
ziurim.lt