Commit graph

24 commits

Author SHA1 Message Date
Chocobo1
4f3d77963f
Add parameter to control whether to unescape HTML entities
Some plugin needed the raw data for further processing.
Related: #22074.

PR #22106.
2025-01-06 19:05:57 +08:00
Chocobo1
cc31a90931
Provide SSL context field
The allows the caller to provide proper SSL parameters and avoid dirty monkey patching to
suppress SSL errors.
2024-12-27 03:53:46 +08:00
Chocobo1
90e457a671
Use built-in method for decoding HTML entities 2024-12-27 03:52:50 +08:00
ducalex
efdc4af448
Search helpers: Add POST support to retrieve_url
This allows passing request_data to retrieve_url in order to create a post request.

PR #21184.

---------

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2024-08-17 13:32:57 +08:00
Chocobo1
69a829dfb0
Clean up search engine
Notable changes:
1. Prevent excessive engine module imports.
2. Replace trivial usage of `join()`.
3. Keep the output text sorted whenever possible.
4. Close handles properly.
5. Print error to stderr, not stdout.
6. Report search job exit code.
7. Print exception message to stderr if exception was thrown when
   running a search job.
8. Utilize XML library to build XML data
   And use 2 spaces as indentation.

PR #21098.
2024-07-22 16:51:57 +08:00
Chocobo1
d71086e400
Add type annotations
A few code are revised because the type checker (mypy) doesn't allow
changing types on a variable.

PR #20935.
2024-06-17 13:18:32 +08:00
BurningMop
dd34c85884
Add optional headers to search request
PR #20923.
2024-06-09 14:03:39 +08:00
Chocobo1
a126a7b493
Adjust user agent version automatically
The version calculation is an estimation and it will drift off after some time. Hopefully the
drift offset won't be noticeable within a few years.

Also switched the user agent to Windows 10 which has the largest portion of users to avoid
standing out from the crowd.

PR #20864.
2024-05-20 13:50:18 +08:00
cayenne17
21a4ab6bac
Update User-Agent
PR #20801.
2024-05-10 21:47:55 +03:00
Chocobo1
6ac36368cd
Update user agent string 2019-08-09 13:12:11 +08:00
Chocobo1
d52c6230e9
Fix defects found by lgtm.com 2018-11-03 00:34:25 +08:00
Chocobo1
bbe76231cf
Reformat python code to be compliant with PEP8
The following command is used:
`pycodestyle --ignore=E265,E722 --max-line-length=100 <py files>`
2018-09-18 12:33:09 +08:00
ngosang
d7ffabe7ca [search engine] Fix novaprinter.py version number 2015-06-23 09:46:19 +02:00
ngosang
ad2a18b3bc Changes in User-Agent 2015-06-12 01:30:01 +02:00
DoumanAsh
86a0eaf317 Exception free retrieve_url()
Set 2 second timeout and handle any possible connection error
Return empty string to engine in case of connection exception
2015-06-10 08:15:23 +03:00
sledgehammer999
1bf7e3cafa Move the searchengine code back into its original place. 2015-02-23 03:44:29 +02:00
Vladimir Golovnev (Glassez)
ff9a281b72 Change project directory structure.
Change project directory structure according to application structure.
Change 'nox' configuration option to something more meaningful 'nogui'.
Rename 'Icons' folder to 'icons' (similar to other folders).
Partially add 'nowebui' option support.
Remove QConf project file.
2015-02-05 19:10:26 +03:00
masux
f1e0ef87a4 This fix qbittorrent/qBittorrent#1949 2014-09-21 09:16:59 +02:00
Martin Janco
1290d7cac4 Fixed extratorrent.cc search engine. 2014-09-15 16:29:20 +02:00
Christophe Dumez
d740b051cb Really fix kat search engine with python3 2013-01-19 19:29:51 +02:00
Christophe Dumez
f369e22de0 Fix kat.ph search with python3 2013-01-19 18:54:18 +02:00
Christophe Dumez
eb159c0b18 Search: Fix GZip decompression code 2011-09-11 21:55:12 +03:00
Christophe Dumez
51b3a5164d Search: Fix torrent download with Python 3 2011-09-11 21:26:30 +03:00
Christophe Dumez
f4c2fdd2fd Search: Initial support for Python 3.x 2011-09-11 20:22:54 +03:00