Beispiel #1
0
def feed(idx):
  url = _FEEDLIST[idx]['url']
  if url.endswith('.json'):
    return chanutils.reddit.get_feed(_FEEDLIST[idx])
  else:
    r = get(url)
    return _extract(r.text)
Beispiel #2
0
def feed(idx):
  url = _FEEDLIST[idx]['url']
  if url.endswith('.json'):
    return chanutils.reddit.get_feed(_FEEDLIST[idx])
  else:
    r = get(url)
    return _extract(r.text)
Beispiel #3
0
def torrent_from_hash(hashid):
  path = "/torrent/" + hashid + ".torrent"
  for site in torr_sites:
    try:
      r = chanutils.get("http://" + site + path)
      return r.content
    except Exception:
      pass
  return None
Beispiel #4
0
def torrent_files(link):
    if link.startswith("magnet:"):
        torrent = magnet2torrent(link)
    else:
        # Remove any parameters from torrent link
        # as some sites may not download if wrong
        idx = link.find('?')
        if idx > -1:
            link = link[:idx]
        r = chanutils.get(link)
        torrent = r.content

    files = None
    if torrent:
        try:
            parser = TorrentParser(torrent)
            files = parser.get_files_details()
        except Exception, e:
            pass
Beispiel #5
0
def torrent_files(link):
  if link.startswith("magnet:"):
    torrent = magnet2torrent(link)
  else:
    # Remove any parameters from torrent link
    # as some sites may not download if wrong
    idx = link.find('?')
    if idx > -1:
      link = link[:idx]
    r = chanutils.get(link)
    torrent = r.content

  files = None
  if torrent:
    try:
      parser = TorrentParser(torrent)
      files =  parser.get_files_details()
    except Exception, e:
      pass
Beispiel #6
0
def search(q):
  r = get(_SEARCH_URL, params={'q':q})
  return _extract(r.text)
Beispiel #7
0
def search(q):
  r = get(_SEARCH_URL, params={'q':q})
  return _extract(r.text)