From 897d1bcf20db07ac183e1e880dbd6cd917d4b6c1 Mon Sep 17 00:00:00 2001 From: Vineet Agarwal <58567019+vineet140502@users.noreply.github.com> Date: Tue, 30 May 2023 14:19:04 +0000 Subject: [PATCH] changed urls --- nsepy/urls.py | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/nsepy/urls.py b/nsepy/urls.py index fb435fc..f77cf30 100644 --- a/nsepy/urls.py +++ b/nsepy/urls.py @@ -13,28 +13,28 @@ session = Session() # headers = { - # 'Host': 'www1.nseindia.com', - # 'Referer': 'https://www1.nseindia.com/products/content/equities/equities/eq_security.htm'} + # 'Host': 'www.nseindia.com', + # 'Referer': 'https://www.nseindia.com/products/content/equities/equities/eq_security.htm'} headers = {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, sdch, br', 'Accept-Language': 'en-GB,en-US;q=0.8,en;q=0.6', 'Connection': 'keep-alive', - 'Host': 'www1.nseindia.com', + 'Host': 'www.nseindia.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36', 'X-Requested-With': 'XMLHttpRequest'} URLFetchSession = partial(URLFetch, session=session, headers=headers) -NSE_SYMBOL_COUNT_URL = 'http://www1.nseindia.com/marketinfo/sym_map/symbolCount.jsp' +NSE_SYMBOL_COUNT_URL = 'http://www.nseindia.com/marketinfo/sym_map/symbolCount.jsp' """ ---------------------------------EQUITY-------------------------------------- """ symbol_count_url = URLFetchSession( - url='http://www1.nseindia.com/marketinfo/sym_map/symbolCount.jsp') + url='http://www.nseindia.com/marketinfo/sym_map/symbolCount.jsp') def get_symbol_count(symbol): @@ -50,7 +50,7 @@ def get_symbol_count(symbol): #symbol=SBIN&segmentLink=3&symbolCount=1&series=EQ&dateRange=1month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE' """ equity_history_url_full = URLFetchSession( - url='http://www1.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp') + url='http://www.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp') """ symbol="SBIN" @@ -70,26 +70,26 @@ def get_symbol_count(symbol): 3. ddMMMyyyy """ price_list_url = URLFetchSession( - url='https://www1.nseindia.com/content/historical/EQUITIES/%s/%s/cm%sbhav.csv.zip') + url='https://www.nseindia.com/content/historical/EQUITIES/%s/%s/cm%sbhav.csv.zip') """ 1. ddmmyyyy """ daily_volatility_url = URLFetchSession( - url='http://www1.nseindia.com/archives/nsccl/volt/CMVOLT_%s.CSV') + url='http://www.nseindia.com/archives/nsccl/volt/CMVOLT_%s.CSV') """ 1. ddmmyyyy """ daily_deliverypositions_url = URLFetchSession( - url='https://www1.nseindia.com/archives/equities/mto/MTO_%s.DAT') + url='https://www.nseindia.com/archives/equities/mto/MTO_%s.DAT') """ 1. ddmmyy """ pr_price_list_zipped_url = URLFetchSession( - url='http://www1.nseindia.com/archives/equities/bhavcopy/pr/PR%s.zip') + url='http://www.nseindia.com/archives/equities/bhavcopy/pr/PR%s.zip') """ @@ -101,7 +101,7 @@ def get_symbol_count(symbol): 3. toDate string dd-mm-yyyy """ index_history_url = URLFetchSession( - url='http://www1.nseindia.com/products/dynaContent/equities/indices/historicalindices.jsp') + url='http://www.nseindia.com/products/dynaContent/equities/indices/historicalindices.jsp') """ 1. ddmmyyyy @@ -117,30 +117,30 @@ def get_symbol_count(symbol): """ index_pe_history_url = partial( URLFetchSession( - url='http://www1.nseindia.com/products/dynaContent/equities/indices/historical_pepb.jsp?'), + url='http://www.nseindia.com/products/dynaContent/equities/indices/historical_pepb.jsp?'), yield1="undefined", yield2="undefined", yield3="undefined", yield4="all") """ -http://www1.nseindia.com/products/dynaContent/equities/indices/hist_vix_data.jsp?&fromDate=01-Nov-2015&toDate=19-Nov-2015 +http://www.nseindia.com/products/dynaContent/equities/indices/hist_vix_data.jsp?&fromDate=01-Nov-2015&toDate=19-Nov-2015 fromDate = 'dd-Mmm-yyyy' toDate = 'dd-Mmm-yyyy' """ index_vix_history_url = URLFetchSession( - url='http://www1.nseindia.com/products/dynaContent/equities/indices/hist_vix_data.jsp') + url='http://www.nseindia.com/products/dynaContent/equities/indices/hist_vix_data.jsp') equity_symbol_list_url = URLFetchSession( - url='https://www1.nseindia.com/content/equities/EQUITY_L.csv') + url='https://www.nseindia.com/content/equities/EQUITY_L.csv') index_constituents_url = URLFetchSession( - "https://www1.nseindia.com/content/indices/ind_%slist.csv") + "https://www.nseindia.com/content/indices/ind_%slist.csv") """ --------------------------DERIVATIVES--------------------------------------- """ derivative_expiry_dates_url = URLFetchSession( - url='http://www1.nseindia.com/products/resources/js/foExp.js') + url='http://www.nseindia.com/products/resources/js/foExp.js') """ instrumentType=FUTIDX @@ -156,21 +156,21 @@ def get_symbol_count(symbol): """ derivative_history_url = partial( URLFetchSession( - url='http://www1.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?', - headers = {**headers, **{'Referer': 'https://www1.nseindia.com/products/content/derivatives/equities/historical_fo.htm'}} - #headers = (lambda a,b: a.update(b) or a)(headers.copy(),{'Referer': 'https://www1.nseindia.com/products/content/derivatives/equities/historical_fo.htm'}) + url='http://www.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?', + headers = {**headers, **{'Referer': 'https://www.nseindia.com/products/content/derivatives/equities/historical_fo.htm'}} + #headers = (lambda a,b: a.update(b) or a)(headers.copy(),{'Referer': 'https://www.nseindia.com/products/content/derivatives/equities/historical_fo.htm'}) ), segmentLink=9, symbolCount='') """ -http://www1.nseindia.com/content/historical/DERIVATIVES/2015/NOV/fo18NOV2015bhav.csv.zip +http://www.nseindia.com/content/historical/DERIVATIVES/2015/NOV/fo18NOV2015bhav.csv.zip 1.year yyyy 2.Month MMM 3.date ddMMMyyyy """ derivative_price_list_url = URLFetchSession( - url="http://www1.nseindia.com/content/historical/DERIVATIVES/%s/%s/fo%sbhav.csv.zip") + url="http://www.nseindia.com/content/historical/DERIVATIVES/%s/%s/fo%sbhav.csv.zip") """ @@ -181,4 +181,4 @@ def get_symbol_count(symbol): toDate dd-mm-yyyy (to date) """ rbi_rate_history_url = URLFetchSession( - "https://www1.nseindia.com/products/dynaContent/derivatives/currency/fxRbiRateHist.jsp") + "https://www.nseindia.com/products/dynaContent/derivatives/currency/fxRbiRateHist.jsp")