페이스북 동영상 다운로더.py
Posted 2014.02.27 17:56, Filed under: 컴퓨터_etc간단하게 소스 짜봤습니다
파이썬 2.7에서 작동하고 저장할 폴더를 save_dir에 지정해서 쓰면 ㅇㅋ
# -*- coding: utf-8 -*- import urllib import re import sys import time def download(url): save_dir='D:\\nyan\\' try: url=urllib.urlopen(url).read() url=url.decode('unicode-escape') url=urllib.unquote(url) url=re.findall('"hd_src":"?(.*?)","',url,re.DOTALL)[0] url=url.replace('\\/','/') url=url.replace('https','http') if 'null' in url: print "no hd" url=url.split('sd_src":"')[1] t=time.localtime() f=time.strftime('%y_%m_%d_%H_%M_%S',t)+'.mp4' fp=open(save_dir+f,'wb') print save_dir+f, c=urllib.urlopen(url).read() fp.write(c) fp.close() del(c) print 'ok' except: print "fail:", sys.exc_traceback.tb_lineno, sys.exc_info()[0] while True: download(raw_input('url:'))
'컴퓨터_etc' 카테고리의 다른 글
LeaveRet 멤버 모집 안내 (0) | 2014.04.05 |
---|---|
크롬 유저 데이터 추출.py (0) | 2014.03.14 |
페이스북 동영상 다운로더.py (0) | 2014.02.27 |
웹툰이 언제 올라왔나 확인할 수 있는 사이트 (2) | 2014.01.28 |
워게임 사이트 만들었습니다! CTFagain.kr (4) | 2014.01.19 |
리버싱 케알 올클 (0) | 2014.01.01 |
Response :
0 Trackbacks
,
0 Comments