def __sjdecode(link): "Extract Rapidshare link from Serienjunkies." site = curl.simple_download(link, '-L') result = LINK_FINDER_RE.search(site) if result is None: return '' else: return "".join(result.groups())
def _resolve_link(link): site = curl.simple_download(link, '-L') result = RSDL_LINK_RE.search(site) if result is None: return None else: group = result.groupdict() path = os.path.split(group['link']) group['link'] = os.path.join(path[0], 'dl', path[1]) return RSDL_BUILD_STR % group
def __rsdecode(link): "Prepare Rapidshare link for final download." if link == '': return '' site = curl.simple_download(link, '-L') pos = site.find("form action") if pos != -1: site = site[pos:] item = LINK_FINDER_RE.search(site) if item is None: return '' path = os.path.split(item.group(2)) link_end = os.path.join(path[0], 'dl', path[1]) link = "".join(("http://", item.group(1), link_end)) return link