Another Bhavcopy Downloader (ABCD)

LOVEENAJYOTHI

Well-Known Member

travi

Well-Known Member
Clicked the above url in Android chrome browser, it downloads fine , a csv file packaged in a zip.
cm01JAN2018bhav.csv.zip
>wget https://www.nseindia.com/content/historical/EQUITIES/2018/JAN/cm01JAN2018bhav.csv.zip
--2018-01-02 17:14:17-- https://www.nseindia.com/content/historical/EQUITIES/2018/JAN/cm01JAN2018bhav.csv.zip
Resolving www.nseindia.com... 184.84.109.57
Connecting to www.nseindia.com|184.84.109.57|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2018-01-02 17:14:18 ERROR 403: Forbidden.

Its probably checking for header or cookie info which lets it work in the browser but a CLI download fails in various tools.
The ABCD tool currently not sending anything specific. this is commented. http/user-agent: "Mozilla/5.0"
 

travi

Well-Known Member
Wasn't that hard to fix it :)

step 1: open the directory C:\PATH\ABCD

step 2: Open/Edit the file named ABCD.r in notepad/wordpad(or ur favourite editor) Right-click and use open with...

step 3: search for this line ";system/schemes/http/user-agent:" [its line 30 in my file]

step 4: remove the ; "semi-colon at the beginning of that line" and replace with this
system/schemes/http/user-agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"

step 5: search for this line >> NSE_Url: to-url rejoin ["http://www.nseindia.com/content/historical/EQUITIES/" [its line number 86 in mine]
Change the http to https

step 6: save the file. and run it.

Wola, it works now. Anyway, I've only tested it with Equity and Indices.
 

LOVEENAJYOTHI

Well-Known Member
Wasn't that hard to fix it :)

step 1: open the directory C:\PATH\ABCD

step 2: Open/Edit the file named ABCD.r in notepad/wordpad(or ur favourite editor) Right-click and use open with...

step 3: search for this line ";system/schemes/http/user-agent:" [its line 30 in my file]

step 4: remove the ; "semi-colon at the beginning of that line" and replace with this
system/schemes/http/user-agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"

step 5: search for this line >> NSE_Url: to-url rejoin ["http://www.nseindia.com/content/historical/EQUITIES/" [its line number 86 in mine]
Change the http to https

step 6: save the file. and run it.

Wola, it works now. Anyway, I've only tested it with Equity and Indices.
Voila indeeeeeed!!!,
Though i dont use ABCD , i can totally relate to the thrill of fixing something.:)
 
Wasn't that hard to fix it :)

step 1: open the directory C:\PATH\ABCD

step 2: Open/Edit the file named ABCD.r in notepad/wordpad(or ur favourite editor) Right-click and use open with...

step 3: search for this line ";system/schemes/http/user-agent:" [its line 30 in my file]

step 4: remove the ; "semi-colon at the beginning of that line" and replace with this
system/schemes/http/user-agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"

step 5: search for this line >> NSE_Url: to-url rejoin ["http://www.nseindia.com/content/historical/EQUITIES/" [its line number 86 in mine]
Change the http to https

step 6: save the file. and run it.

Wola, it works now. Anyway, I've only tested it with Equity and Indices.


Thanks a ton dude :)
Even FNO works - just need to rename the http to https

Tx Travi; and tx Josh for a really cool utility :)
 

Similar threads