NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

richard42ack's avatar
Dec 12, 2020

How to download readyshare files using python

From a browser, I am able to access both directory listings and file contents.

 

Using the python requests library, I am able to list the directory on readyshare.

However, I have not been able to download any of its files. 

 

All file requests result in the same output as below (chevrons changed). 
Is a different approach needed using some other endpoint or form?

Thanks, Richard.


(upload might be nice too, but not needed just now)

_html__head__meta http-equiv="Content-Type" content="text/html; charset=UTF-8"__meta http-equiv=\'Pragma\' content=\'no-cache\'__meta http-equiv=\'Cache-Control\' content=\'no-cache\'__title_ NETGEAR Router WAC124_/title__script language="javascript" type="text/javascript"_function redirect(){top.location.href ="sso_loading.html";}_/script__/head__body onLoad=redirect()__form name="formname"__/form__/body__/html_

 

import requests
s = requests.Session()

req = s.get('http://readyshare.routerlogin.net/shares/S_Drive') # gets html list ok

print(req.content)
req = s.get('http://readyshare.routerlogin.net/shares/S_Drive/example.txt') # nope
print(req.content)

# (headers not shown, but were set to same as the ones used by the browser)

3 Replies

  • > Model: AC2100|Nighthawk AC2100 Smart WiFi Router

     

       Firmware version?  Connected to what?

     

    > From a browser, [...]

     

       Which?  Running on what?  Which is connected how to what?

     

    > Using the python requests library, [...]

     

       Running on what?  Which is connected how to what?

     

    > [...]_title_ NETGEAR Router WAC124_/title_[...]

     

       Have you any idea why an AC2100 would put a title tag in its response
    which included _that_ (different) model number?  At least one of us
    seems to be confused.

     

       If I had multiple Netgear routery devices on my LAN, and I wanted to
    deal with a particular one of them, then I might specify its LAN IP
    address rather than any "routerlogin" name.


    > # (headers not shown, but were set to same as the ones used by the
    > browser)

     

       "headers"?  (Do I care?)

    • richard42ack's avatar
      richard42ack
      Guide

      Never mind I have solved it.

      Make the call to the file a second time and it returns the file.

       

      To answer questions:

      1. This is wrt readyshare, which is similar on various netgear products but seems to have no documentation about how they work.

      2. You might not care, but it is quite often the case that the server will. By providing the same headers as the browser, we eliminate that as an issue.

      3. I had forgotten which of my routers was the one with the usb -- and didn't give it a whole lot of attention when filling out the item they asked for -- it is after all, mostly a software issue, not a hardware one.