URLs for EVN_* download changed
authorgregor herrmann <gregoa@debian.org>
Fri, 7 Apr 2017 18:10:16 +0000 (20:10 +0200)
committergregor herrmann <gregoa@debian.org>
Fri, 7 Apr 2017 18:10:16 +0000 (20:10 +0200)
bob_download.py

index 5c67bcde2f661cf2af3313ae7c4c52eb7ae46f6f..170d2cb4efc41bc1267d44d052b43cb579e1c625 100755 (executable)
@@ -79,8 +79,8 @@ def main(username, password, destdir, csv_format):
                 file.write(response.content)
 
     # Download CSVs
-    # Links look like '/bill.set.obp?bsn=61'
-    regexp = re.compile(r'\/bill.set.obp\?')
+    # Links look like '/bill.ctn.cdr.obp?bsn=116'
+    regexp = re.compile(r'\/bill.ctn.cdr.obp\?')
     links = html.findAll('a', href=regexp)
     for link in links:
         url = link['href']
@@ -92,7 +92,7 @@ def main(username, password, destdir, csv_format):
         assert 'OBP.utils.reloadAfterDelay("/bill.ctn.cdr.set.obp",5);' not in response.text
         html = BeautifulSoup(response.text, 'html.parser')
         assert html.find('a', id='link_csv_download') is not None
-        response = session.get('https://rechnung.bob.at/download.table.obp?fmt={}&table=obp.calls.table'.format(csv_format))
+        response = session.get('https://rechnung.bob.at/obp/download.obp?fmt={}&table=obp.calls.table'.format(csv_format))
         assert response.ok
         filename = response.headers['Content-Disposition'].split('=')[1] # e.g. 'EVN_1509_523260091_1_069911934859.txt'
         assert filename.startswith('EVN_')