Skip to content

Instantly share code, notes, and snippets.

@namuol
Created November 24, 2012 11:02
Show Gist options
  • Save namuol/4139191 to your computer and use it in GitHub Desktop.
Save namuol/4139191 to your computer and use it in GitHub Desktop.
Rip hidden pre-buffered FLV files.
#!/usr/bin/python
import os
psfilter = 'flashplayer'
lnfilter = 'Flash'
dirs = ('/proc/%s/fd' % p for p, c in [x.rstrip('\n').split(' ', 1) \
for x in os.popen('ps h -eo pid:1,command')] if psfilter in c)
possible_videos = []
for d in dirs:
for f in os.listdir(d):
f=d+'/'+f
if os.path.islink(f) and lnfilter in os.readlink(f):
possible_videos.append(f)
for f in possible_videos:
print(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment