
Guardar y chequear descargas realizadas en un archivo de texto.
Publicado por Manuel (7 intervenciones) el 09/12/2013 21:54:04
Buenas noches a todos.
Estoy aprendiendo Python e hice un script para bajar unas series de anime, pero me gustaría guardar en un archivo de texto las descargas ya realizadas, así la próxima vez que ejecutara el script, no me descargue otra vez algún episodio ya bajado.
Este es el código de lo que tengo hecho.
Muchas gracias por vuestro tiempo y ayuda.
Manuel.
Estoy aprendiendo Python e hice un script para bajar unas series de anime, pero me gustaría guardar en un archivo de texto las descargas ya realizadas, así la próxima vez que ejecutara el script, no me descargue otra vez algún episodio ya bajado.
Este es el código de lo que tengo hecho.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
import re, urllib
import webbrowser
import time
def descarga_anime():
lista_anime = ["coppelion", "flamenco", "freezing", "hajime", "log-horizon", "valvrave", "arpeggio"]
myurl = "http://www.animetake.com"
for i in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(myurl).read(), re.I):
#time.sleep(900)
for serie in lista_anime:
if serie in i and "episode" in i:
webbrowser.open(i)
time.sleep(4)
for torrent in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(i).read(), re.I):
if "nyaa.se" in torrent:
if "#038" in torrent:
torrent = torrent.replace("#038;", "")
torrent = torrent.replace("amp;", "").replace(" ", "")
webbrowser.open(torrent)
time.sleep(4)
break
descarga_anime()
Muchas gracias por vuestro tiempo y ayuda.
Manuel.
Valora esta pregunta


1