Sorrow446 / ZS-DL

CLI Zippyshare downloader written in Python.
26 stars 12 forks source link

Can't download Zippyshare Change their pattern again #7

Closed chickenstealers closed 3 years ago

chickenstealers commented 3 years ago

Can't download Zippyshare Change their pattern again

darkcumulus commented 3 years ago

the location of the URL generator is moved to new location i think, but from the looks of it still the same algo.

ZolanPro commented 3 years ago

Update extract function:

def extract(url, server, id):
    regex = (
        r'document.getElementById\(\'dlbutton\'\).href = "/d/[a-zA-Z\d]{8}/" \+ \((\d+) % (\d+) \+ (\d+) % (\d+)\) \+ "\/(.+)";'
    )
    for _ in range(3):
        r = s.get(url)
        if r.status_code != 500:
            break
        time.sleep(1)
    r.raise_for_status()
    meta = re.search(regex, r.text)
    if not meta:
        raise Exception('Failed to get file URL. File down or pattern changed.')
    num_1 = int(meta.group(1))
    num_2 = int(meta.group(2))
    num_3 = int(meta.group(3))
    num_4 = int(meta.group(4))
    final_num = num_1 % num_2 + num_3 % num_4
    enc_fname = meta.group(5)
    file_url = "https://www{}.zippyshare.com/d/{}/{}/{}".format(server,id,final_num,enc_fname)  
    fname = unquote(enc_fname)
    return file_url, fname
chickenstealers commented 3 years ago

Update extract function:

def extract(url, server, id):
  regex = (
      r'document.getElementById\(\'dlbutton\'\).href = "/d/[a-zA-Z\d]{8}/" \+ \((\d+) % (\d+) \+ (\d+) % (\d+)\) \+ "\/(.+)";'
  )
  for _ in range(3):
      r = s.get(url)
      if r.status_code != 500:
          break
      time.sleep(1)
  r.raise_for_status()
  meta = re.search(regex, r.text)
  if not meta:
      raise Exception('Failed to get file URL. File down or pattern changed.')
  num_1 = int(meta.group(1))
  num_2 = int(meta.group(2))
  num_3 = int(meta.group(3))
  num_4 = int(meta.group(4))
  final_num = num_1 % num_2 + num_3 % num_4
  enc_fname = meta.group(5)
  file_url = "https://www{}.zippyshare.com/d/{}/{}/{}".format(server,id,final_num,enc_fname)  
  fname = unquote(enc_fname)
  return file_url, fname

Thanks working great

Sorrow446 commented 3 years ago

They went back to their previous pattern. Pushed to script.