|
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 |
|
4 | 4 | __author__ = 'L' |
5 | | -__version__ = '2.6.0' |
| 5 | +__version__ = '3.0.0' |
6 | 6 |
|
7 | 7 | import sys |
8 | 8 | import os |
@@ -485,23 +485,24 @@ def askGeorg(conn, connectURLs, redirectURLs): |
485 | 485 | need_exit = False |
486 | 486 | try: |
487 | 487 | response = conn.get(connectURLs[0], headers=headers, timeout=10) |
488 | | - if 'Expires' in response.headers: |
489 | | - expires = response.headers['Expires'] |
490 | | - try: |
491 | | - expires_date = datetime.strptime(expires, '%a, %d %b %Y %H:%M:%S %Z') |
492 | | - if mktime(expires_date.timetuple()) < time(): |
493 | | - log.warning('Server Session expired') |
494 | | - if 'Set-Cookie' in response.headers: |
495 | | - cookie = '' |
496 | | - for k, v in response.cookies.items(): |
497 | | - cookie += '{}={};'.format(k, v) |
498 | | - HEADERS.update({'Cookie' : cookie}) |
499 | | - log.warning("Automatically append Cookies: {}".format(cookie)) |
500 | | - else: |
501 | | - log.error('There is no valid cookie return') |
502 | | - need_exit = True |
503 | | - except ValueError: |
504 | | - log.warning('Expires wrong format: {}'.format(expires)) |
| 488 | + if '.php' in connectURLs[0]: |
| 489 | + if 'Expires' in response.headers: |
| 490 | + expires = response.headers['Expires'] |
| 491 | + try: |
| 492 | + expires_date = datetime.strptime(expires, '%a, %d %b %Y %H:%M:%S %Z') |
| 493 | + if mktime(expires_date.timetuple()) < time(): |
| 494 | + log.warning('Server Session expired') |
| 495 | + if 'Set-Cookie' in response.headers: |
| 496 | + cookie = '' |
| 497 | + for k, v in response.cookies.items(): |
| 498 | + cookie += '{}={};'.format(k, v) |
| 499 | + HEADERS.update({'Cookie' : cookie}) |
| 500 | + log.warning("Automatically append Cookies: {}".format(cookie)) |
| 501 | + else: |
| 502 | + log.error('There is no valid cookie return') |
| 503 | + need_exit = True |
| 504 | + except ValueError: |
| 505 | + log.warning('Expires wrong format: {}'.format(expires)) |
505 | 506 | except: |
506 | 507 | log.error("Georg is not ready, please check URL.") |
507 | 508 | exit() |
|
0 commit comments