Skip to content

Commit fb50cf8

Browse files
authored
Merge pull request #42 from libenc/patch-1
Fix some vaild `lang_result` that get incorrectly fallbacked
2 parents bfca3eb + c1ca1cf commit fb50cf8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,4 @@ Project Link: [https://github.com/opsdisk/yagooglesearch](https://github.com/ops
305305
* [KennBro](https://github.com/KennBro) - <https://github.com/opsdisk/yagooglesearch/pull/9>
306306
* [ArshansGithub](https://github.com/ArshansGithub) - <https://github.com/opsdisk/yagooglesearch/pull/21>
307307
* [pguridi](https://github.com/pguridi) - <https://github.com/opsdisk/yagooglesearch/pull/38>
308+
* [libenc](https://github.com/libenc) - <https://github.com/opsdisk/yagooglesearch/pull/42>

src/yagooglesearch/__init__.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Custom Python libraries.
1515

1616

17-
__version__ = "1.9.0"
17+
__version__ = "1.10.0"
1818

1919
# Logging
2020
ROOT_LOGGER = logging.getLogger("yagooglesearch")
@@ -144,7 +144,11 @@ def __init__(
144144
self.query = urllib.parse.quote_plus(query)
145145
self.tld = tld
146146
self.lang_html_ui = lang_html_ui
147-
self.lang_result = lang_result.lower()
147+
self.lang_result = (
148+
lang_result.lower()
149+
if "-" not in lang_result
150+
else f"{lang_result.split('-')[0].lower()}-{lang_result.split('-')[1].upper()}"
151+
)
148152
self.tbs = tbs
149153
self.safe = safe
150154
self.start = start

0 commit comments

Comments
 (0)