Skip to content

Commit 1610dfb

Browse files
authored
Add files via upload
1 parent d253f32 commit 1610dfb

10 files changed

Lines changed: 590 additions & 44 deletions

PyWWW/pywwwget_bard.py

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io
2121
import re
2222
import sys
23+
import platform
2324
import socket
2425
import shutil
2526
import time
@@ -286,11 +287,66 @@ def unquote(x): return x
286287
from ftplib import FTP, all_errors
287288

288289
# --- Configuration ---
290+
__use_pysftp__ = False
291+
if(not havepysftp):
292+
__use_pysftp__ = False
293+
__use_http_lib__ = "httpx"
294+
if(__use_http_lib__ == "httpx" and haverequests and not havehttpx):
295+
__use_http_lib__ = "requests"
296+
if(__use_http_lib__ == "requests" and havehttpx and not haverequests):
297+
__use_http_lib__ = "httpx"
298+
if((__use_http_lib__ == "httpx" or __use_http_lib__ == "requests") and not havehttpx and not haverequests):
299+
__use_http_lib__ = "urllib"
300+
289301
__program_name__ = "PyWWW-Get"
302+
__program_alt_name__ = "PyWWWGet"
303+
__program_small_name__ = "wwwget"
290304
__project__ = __program_name__
291-
__version__ = "clean-tls-v36-opt"
292-
__use_http_lib__ = "httpx" if havehttpx else ("requests" if haverequests else "urllib")
293-
__use_pysftp__ = False
305+
__project_url__ = "https://github.com/GameMaker2k/PyWWW-Get"
306+
__version_info__ = (2, 1, 6, "RC 1", 1)
307+
__version_date_info__ = (2025, 8, 14, "RC 1", 1)
308+
__version_date__ = str(__version_date_info__[0])+"."+str(__version_date_info__[
309+
1]).zfill(2)+"."+str(__version_date_info__[2]).zfill(2)
310+
__revision__ = __version_info__[3]
311+
__revision_id__ = "$Id$"
312+
if(__version_info__[4] is not None):
313+
__version_date_plusrc__ = __version_date__ + \
314+
"-"+str(__version_date_info__[4])
315+
if(__version_info__[4] is None):
316+
__version_date_plusrc__ = __version_date__
317+
if(__version_info__[3] is not None):
318+
__version__ = str(__version_info__[0])+"."+str(__version_info__[1])+"."+str(
319+
__version_info__[2])+" "+str(__version_info__[3])
320+
if(__version_info__[3] is None):
321+
__version__ = str(
322+
__version_info__[0])+"."+str(__version_info__[1])+"."+str(__version_info__[2])
323+
324+
PyBitness = platform.architecture()
325+
if(PyBitness == "32bit" or PyBitness == "32"):
326+
PyBitness = "32"
327+
elif(PyBitness == "64bit" or PyBitness == "64"):
328+
PyBitness = "64"
329+
else:
330+
PyBitness = "32"
331+
332+
geturls_ua_pywwwget_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
333+
proname=__project__, prover=__version__, prourl=__project_url__)
334+
if(platform.python_implementation() != ""):
335+
py_implementation = platform.python_implementation()
336+
if(platform.python_implementation() == ""):
337+
py_implementation = "Python"
338+
geturls_ua_pywwwget_python_alt = "Mozilla/5.0 ({osver}; {archtype}; +{prourl}) {pyimp}/{pyver} (KHTML, like Gecko) {proname}/{prover}".format(osver=platform.system(
339+
)+" "+platform.release(), archtype=platform.machine(), prourl=__project_url__, pyimp=py_implementation, pyver=platform.python_version(), proname=__project__, prover=__version__)
340+
geturls_ua_googlebot_google = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
341+
geturls_ua_googlebot_google_old = "Googlebot/2.1 (+http://www.google.com/bot.html)"
342+
geturls_headers_pywwwget_python = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
343+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
344+
geturls_headers_pywwwget_python_alt = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python_alt, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
345+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
346+
geturls_headers_googlebot_google = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
347+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
348+
geturls_headers_googlebot_google_old = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google_old, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
349+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
294350

295351
__use_inmem__ = True
296352
__use_memfd__ = True

PyWWW/pywwwget_chatgpt.py

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import io
6161
import re
6262
import sys
63+
import platform
6364
import socket
6465
import shutil
6566
import time
@@ -333,13 +334,67 @@ def unquote(x): # very small fallback
333334
basestring = str
334335

335336

337+
# --- Configuration ---
338+
__use_pysftp__ = False
339+
if(not havepysftp):
340+
__use_pysftp__ = False
341+
__use_http_lib__ = "httpx"
342+
if(__use_http_lib__ == "httpx" and haverequests and not havehttpx):
343+
__use_http_lib__ = "requests"
344+
if(__use_http_lib__ == "requests" and havehttpx and not haverequests):
345+
__use_http_lib__ = "httpx"
346+
if((__use_http_lib__ == "httpx" or __use_http_lib__ == "requests") and not havehttpx and not haverequests):
347+
__use_http_lib__ = "urllib"
348+
336349
__program_name__ = "PyWWW-Get"
350+
__program_alt_name__ = "PyWWWGet"
351+
__program_small_name__ = "wwwget"
337352
__project__ = __program_name__
338353
__project_url__ = "https://github.com/GameMaker2k/PyWWW-Get"
339-
__version__ = "clean-tls-v35"
340-
341-
__use_http_lib__ = "httpx" if havehttpx else ("requests" if haverequests else "urllib")
342-
__use_pysftp__ = False # can toggle
354+
__version_info__ = (2, 1, 6, "RC 1", 1)
355+
__version_date_info__ = (2025, 8, 14, "RC 1", 1)
356+
__version_date__ = str(__version_date_info__[0])+"."+str(__version_date_info__[
357+
1]).zfill(2)+"."+str(__version_date_info__[2]).zfill(2)
358+
__revision__ = __version_info__[3]
359+
__revision_id__ = "$Id$"
360+
if(__version_info__[4] is not None):
361+
__version_date_plusrc__ = __version_date__ + \
362+
"-"+str(__version_date_info__[4])
363+
if(__version_info__[4] is None):
364+
__version_date_plusrc__ = __version_date__
365+
if(__version_info__[3] is not None):
366+
__version__ = str(__version_info__[0])+"."+str(__version_info__[1])+"."+str(
367+
__version_info__[2])+" "+str(__version_info__[3])
368+
if(__version_info__[3] is None):
369+
__version__ = str(
370+
__version_info__[0])+"."+str(__version_info__[1])+"."+str(__version_info__[2])
371+
372+
PyBitness = platform.architecture()
373+
if(PyBitness == "32bit" or PyBitness == "32"):
374+
PyBitness = "32"
375+
elif(PyBitness == "64bit" or PyBitness == "64"):
376+
PyBitness = "64"
377+
else:
378+
PyBitness = "32"
379+
380+
geturls_ua_pywwwget_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
381+
proname=__project__, prover=__version__, prourl=__project_url__)
382+
if(platform.python_implementation() != ""):
383+
py_implementation = platform.python_implementation()
384+
if(platform.python_implementation() == ""):
385+
py_implementation = "Python"
386+
geturls_ua_pywwwget_python_alt = "Mozilla/5.0 ({osver}; {archtype}; +{prourl}) {pyimp}/{pyver} (KHTML, like Gecko) {proname}/{prover}".format(osver=platform.system(
387+
)+" "+platform.release(), archtype=platform.machine(), prourl=__project_url__, pyimp=py_implementation, pyver=platform.python_version(), proname=__project__, prover=__version__)
388+
geturls_ua_googlebot_google = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
389+
geturls_ua_googlebot_google_old = "Googlebot/2.1 (+http://www.google.com/bot.html)"
390+
geturls_headers_pywwwget_python = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
391+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
392+
geturls_headers_pywwwget_python_alt = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python_alt, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
393+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
394+
geturls_headers_googlebot_google = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
395+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
396+
geturls_headers_googlebot_google_old = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google_old, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
397+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
343398

344399
__use_inmem__ = True
345400
__use_memfd__ = True

PyWWW/pywwwget_deepseek.py

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io
2828
import re
2929
import sys
30+
import platform
3031
import socket
3132
import shutil
3233
import time
@@ -317,16 +318,67 @@ def unquote(x): # very small fallback
317318
except NameError:
318319
basestring = str
319320

320-
# Module metadata
321+
# --- Configuration ---
322+
__use_pysftp__ = False
323+
if(not havepysftp):
324+
__use_pysftp__ = False
325+
__use_http_lib__ = "httpx"
326+
if(__use_http_lib__ == "httpx" and haverequests and not havehttpx):
327+
__use_http_lib__ = "requests"
328+
if(__use_http_lib__ == "requests" and havehttpx and not haverequests):
329+
__use_http_lib__ = "httpx"
330+
if((__use_http_lib__ == "httpx" or __use_http_lib__ == "requests") and not havehttpx and not haverequests):
331+
__use_http_lib__ = "urllib"
332+
321333
__program_name__ = "PyWWW-Get"
334+
__program_alt_name__ = "PyWWWGet"
335+
__program_small_name__ = "wwwget"
322336
__project__ = __program_name__
323337
__project_url__ = "https://github.com/GameMaker2k/PyWWW-Get"
324-
__version__ = "optimized-v1.0"
325-
__author__ = "Optimized Version"
326-
__license__ = "MIT"
327-
328-
__use_http_lib__ = "httpx" if havehttpx else ("requests" if haverequests else "urllib")
329-
__use_pysftp__ = False # can toggle
338+
__version_info__ = (2, 1, 6, "RC 1", 1)
339+
__version_date_info__ = (2025, 8, 14, "RC 1", 1)
340+
__version_date__ = str(__version_date_info__[0])+"."+str(__version_date_info__[
341+
1]).zfill(2)+"."+str(__version_date_info__[2]).zfill(2)
342+
__revision__ = __version_info__[3]
343+
__revision_id__ = "$Id$"
344+
if(__version_info__[4] is not None):
345+
__version_date_plusrc__ = __version_date__ + \
346+
"-"+str(__version_date_info__[4])
347+
if(__version_info__[4] is None):
348+
__version_date_plusrc__ = __version_date__
349+
if(__version_info__[3] is not None):
350+
__version__ = str(__version_info__[0])+"."+str(__version_info__[1])+"."+str(
351+
__version_info__[2])+" "+str(__version_info__[3])
352+
if(__version_info__[3] is None):
353+
__version__ = str(
354+
__version_info__[0])+"."+str(__version_info__[1])+"."+str(__version_info__[2])
355+
356+
PyBitness = platform.architecture()
357+
if(PyBitness == "32bit" or PyBitness == "32"):
358+
PyBitness = "32"
359+
elif(PyBitness == "64bit" or PyBitness == "64"):
360+
PyBitness = "64"
361+
else:
362+
PyBitness = "32"
363+
364+
geturls_ua_pywwwget_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
365+
proname=__project__, prover=__version__, prourl=__project_url__)
366+
if(platform.python_implementation() != ""):
367+
py_implementation = platform.python_implementation()
368+
if(platform.python_implementation() == ""):
369+
py_implementation = "Python"
370+
geturls_ua_pywwwget_python_alt = "Mozilla/5.0 ({osver}; {archtype}; +{prourl}) {pyimp}/{pyver} (KHTML, like Gecko) {proname}/{prover}".format(osver=platform.system(
371+
)+" "+platform.release(), archtype=platform.machine(), prourl=__project_url__, pyimp=py_implementation, pyver=platform.python_version(), proname=__project__, prover=__version__)
372+
geturls_ua_googlebot_google = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
373+
geturls_ua_googlebot_google_old = "Googlebot/2.1 (+http://www.google.com/bot.html)"
374+
geturls_headers_pywwwget_python = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
375+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
376+
geturls_headers_pywwwget_python_alt = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pywwwget_python_alt, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
377+
'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
378+
geturls_headers_googlebot_google = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
379+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
380+
geturls_headers_googlebot_google_old = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google_old, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
381+
'Accept-Charset': "ISO-8859-1,ISO-8859-15,utf-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
330382

331383
__use_inmem__ = True
332384
__use_memfd__ = True

0 commit comments

Comments
 (0)