if not os.path.exists(new_dir): os.makedirs(new_dir) i = 0; for list_id in decode_x(content[11:-3], 'id'): if names[i] in skip_lists: i += 1 continue print font_colors.HEADER + names[i] + font_colors.ENDC #print list_id for dirname in get_new(list_id, config_file): test_name = os.path.join(nzb_path, names[i], dirname + '_*_*Mb.nzb') print 'searching for: %s' % dirname disk_file = glob.glob(test_name) if len(disk_file) == 0: nzb = search_nzbsites(dirname, silent_dl, config_file) #print nzb if (nzb[0] == 0): #TODO: check filenames, they may contain illegal characters filename = os.path.join(nzb_path, names[i], dirname + '_' + nzb[3] + '_' + nzb[2] + 'Mb.nzb') #print nzb[1] urllib.urlretrieve(nzb[1], filename) print font_colors.OKGREEN + '\t DL: ' + filename + font_colors.ENDC else: #TODO: replace string concant with format strings print font_colors.FAIL + '\t ' + nzb[1] + font_colors.ENDC else: print font_colors.WARNING + '\t' + disk_file[0] + ' already exists' + font_colors.ENDC i = i+1 #print decode_id(open('favs_lists', 'r').read()[11:-4])
if not os.path.exists(new_dir): os.makedirs(new_dir) i = 0 for list_id in decode_x(content[11:-3], 'id'): if names[i] in skip_lists: i += 1 continue print font_colors.HEADER + names[i] + font_colors.ENDC #print list_id for dirname in get_new(list_id, config_file): test_name = os.path.join(nzb_path, names[i], dirname + '_*_*Mb.nzb') print 'searching for: %s' % dirname disk_file = glob.glob(test_name) if len(disk_file) == 0: nzb = search_nzbsites(dirname, silent_dl, config_file) #print nzb if (nzb[0] == 0): #TODO: check filenames, they may contain illegal characters filename = os.path.join( nzb_path, names[i], dirname + '_' + nzb[3] + '_' + nzb[2] + 'Mb.nzb') #print nzb[1] urllib.urlretrieve(nzb[1], filename) print font_colors.OKGREEN + '\t DL: ' + filename + font_colors.ENDC else: #TODO: replace string concant with format strings print font_colors.FAIL + '\t ' + nzb[1] + font_colors.ENDC else: print font_colors.WARNING + '\t' + disk_file[ 0] + ' already exists' + font_colors.ENDC
while 1: if user_in == '': break else: rels.append(user_in) user_in = raw_input() else: rels = sys.argv[1:] new_dir = os.path.join(nzb_path, 'manual') if not os.path.exists(new_dir): os.makedirs(new_dir) if not rels == []: for rel in rels: nzb = search_nzbsites(rel, False, config_file) if nzb[0] == 0: #print nzb[1] filename = '%(dirname)s_%(source)s_%(size)sMb.nzb' % { 'dirname': rel, 'source': nzb[3], 'size': nzb[2] } urllib.urlretrieve(nzb[1], os.path.join(nzb_path, 'manual', filename)) print font_colors.OKGREEN + '\t DL:' + filename + font_colors.ENDC else: print font_colors.FAIL + '\t ' + nzb[1] + font_colors.ENDC #print search_nzbsites('DmC.Devil.may.Cry-RELOADED', False, config_file)
config_file = os.path.join(config_path, config_file) if len(sys.argv) < 2: rels = [] user_in = raw_input('Enter releases to search:\n') while 1: if user_in == '': break else: rels.append(user_in) user_in = raw_input() else: rels = sys.argv[1:] new_dir = os.path.join(nzb_path, 'manual') if not os.path.exists(new_dir): os.makedirs(new_dir) if not rels == []: for rel in rels: nzb = search_nzbsites(rel, False, config_file) if nzb[0]==0: #print nzb[1] filename = '%(dirname)s_%(source)s_%(size)sMb.nzb' % {'dirname': rel, 'source': nzb[3], 'size': nzb[2]} urllib.urlretrieve(nzb[1], os.path.join(nzb_path, 'manual', filename)) print font_colors.OKGREEN + '\t DL:' + filename + font_colors.ENDC else: print font_colors.FAIL + '\t ' + nzb[1] + font_colors.ENDC #print search_nzbsites('DmC.Devil.may.Cry-RELOADED', False, config_file)