Browse Source

アップストリームの更新のマージ

master
nexryai 3 weeks ago
parent
commit
b3b83cd499
Signed by: nexryai
GPG Key ID: 6CCD82A3AAFD1203
  1. 9
      docs/src/searx.plugins.tor_check.rst
  2. 4
      requirements-dev.txt
  3. 46
      searx/data/engine_descriptions.json
  4. 49
      searx/engines/bing.py
  5. 67
      searx/engines/emojipedia.py
  6. 128
      searx/network/__init__.py
  7. 25
      searx/network/network.py
  8. 88
      searx/plugins/tor_check.py
  9. 6
      searx/settings.yml
  10. 2
      searx/templates/simple/new_issue.html
  11. 4
      searx/templates/simple/preferences.html
  12. BIN
      searx/translations/ar/LC_MESSAGES/messages.mo
  13. 68
      searx/translations/ar/LC_MESSAGES/messages.po
  14. BIN
      searx/translations/bg/LC_MESSAGES/messages.mo
  15. 64
      searx/translations/bg/LC_MESSAGES/messages.po
  16. BIN
      searx/translations/bn/LC_MESSAGES/messages.mo
  17. 62
      searx/translations/bn/LC_MESSAGES/messages.po
  18. BIN
      searx/translations/bo/LC_MESSAGES/messages.mo
  19. 54
      searx/translations/bo/LC_MESSAGES/messages.po
  20. BIN
      searx/translations/ca/LC_MESSAGES/messages.mo
  21. 64
      searx/translations/ca/LC_MESSAGES/messages.po
  22. BIN
      searx/translations/cs/LC_MESSAGES/messages.mo
  23. 72
      searx/translations/cs/LC_MESSAGES/messages.po
  24. BIN
      searx/translations/cy/LC_MESSAGES/messages.mo
  25. 54
      searx/translations/cy/LC_MESSAGES/messages.po
  26. BIN
      searx/translations/da/LC_MESSAGES/messages.mo
  27. 59
      searx/translations/da/LC_MESSAGES/messages.po
  28. BIN
      searx/translations/de/LC_MESSAGES/messages.mo
  29. 62
      searx/translations/de/LC_MESSAGES/messages.po
  30. BIN
      searx/translations/el_GR/LC_MESSAGES/messages.mo
  31. 64
      searx/translations/el_GR/LC_MESSAGES/messages.po
  32. BIN
      searx/translations/en/LC_MESSAGES/messages.mo
  33. 54
      searx/translations/en/LC_MESSAGES/messages.po
  34. BIN
      searx/translations/eo/LC_MESSAGES/messages.mo
  35. 54
      searx/translations/eo/LC_MESSAGES/messages.po
  36. BIN
      searx/translations/es/LC_MESSAGES/messages.mo
  37. 73
      searx/translations/es/LC_MESSAGES/messages.po
  38. BIN
      searx/translations/et/LC_MESSAGES/messages.mo
  39. 54
      searx/translations/et/LC_MESSAGES/messages.po
  40. BIN
      searx/translations/eu/LC_MESSAGES/messages.mo
  41. 54
      searx/translations/eu/LC_MESSAGES/messages.po
  42. BIN
      searx/translations/fa_IR/LC_MESSAGES/messages.mo
  43. 64
      searx/translations/fa_IR/LC_MESSAGES/messages.po
  44. BIN
      searx/translations/fi/LC_MESSAGES/messages.mo
  45. 64
      searx/translations/fi/LC_MESSAGES/messages.po
  46. BIN
      searx/translations/fil/LC_MESSAGES/messages.mo
  47. 137
      searx/translations/fil/LC_MESSAGES/messages.po
  48. BIN
      searx/translations/fr/LC_MESSAGES/messages.mo
  49. 72
      searx/translations/fr/LC_MESSAGES/messages.po
  50. BIN
      searx/translations/gl/LC_MESSAGES/messages.mo
  51. 88
      searx/translations/gl/LC_MESSAGES/messages.po
  52. BIN
      searx/translations/he/LC_MESSAGES/messages.mo
  53. 66
      searx/translations/he/LC_MESSAGES/messages.po
  54. BIN
      searx/translations/hr/LC_MESSAGES/messages.mo
  55. 54
      searx/translations/hr/LC_MESSAGES/messages.po
  56. BIN
      searx/translations/hu/LC_MESSAGES/messages.mo
  57. 91
      searx/translations/hu/LC_MESSAGES/messages.po
  58. BIN
      searx/translations/ia/LC_MESSAGES/messages.mo
  59. 54
      searx/translations/ia/LC_MESSAGES/messages.po
  60. BIN
      searx/translations/id/LC_MESSAGES/messages.mo
  61. 68
      searx/translations/id/LC_MESSAGES/messages.po
  62. BIN
      searx/translations/it/LC_MESSAGES/messages.mo
  63. 75
      searx/translations/it/LC_MESSAGES/messages.po
  64. 58
      searx/translations/ja/LC_MESSAGES/messages.po
  65. BIN
      searx/translations/ko/LC_MESSAGES/messages.mo
  66. 62
      searx/translations/ko/LC_MESSAGES/messages.po
  67. BIN
      searx/translations/lt/LC_MESSAGES/messages.mo
  68. 75
      searx/translations/lt/LC_MESSAGES/messages.po
  69. BIN
      searx/translations/lv/LC_MESSAGES/messages.mo
  70. 64
      searx/translations/lv/LC_MESSAGES/messages.po
  71. 54
      searx/translations/messages.pot
  72. BIN
      searx/translations/ms/LC_MESSAGES/messages.mo
  73. 75
      searx/translations/ms/LC_MESSAGES/messages.po
  74. BIN
      searx/translations/nb_NO/LC_MESSAGES/messages.mo
  75. 62
      searx/translations/nb_NO/LC_MESSAGES/messages.po
  76. BIN
      searx/translations/nl/LC_MESSAGES/messages.mo
  77. 61
      searx/translations/nl/LC_MESSAGES/messages.po
  78. BIN
      searx/translations/oc/LC_MESSAGES/messages.mo
  79. 54
      searx/translations/oc/LC_MESSAGES/messages.po
  80. BIN
      searx/translations/pap/LC_MESSAGES/messages.mo
  81. 67
      searx/translations/pap/LC_MESSAGES/messages.po
  82. BIN
      searx/translations/pl/LC_MESSAGES/messages.mo
  83. 59
      searx/translations/pl/LC_MESSAGES/messages.po
  84. BIN
      searx/translations/pt/LC_MESSAGES/messages.mo
  85. 64
      searx/translations/pt/LC_MESSAGES/messages.po
  86. BIN
      searx/translations/pt_BR/LC_MESSAGES/messages.mo
  87. 62
      searx/translations/pt_BR/LC_MESSAGES/messages.po
  88. BIN
      searx/translations/ro/LC_MESSAGES/messages.mo
  89. 54
      searx/translations/ro/LC_MESSAGES/messages.po
  90. BIN
      searx/translations/ru/LC_MESSAGES/messages.mo
  91. 62
      searx/translations/ru/LC_MESSAGES/messages.po
  92. BIN
      searx/translations/sk/LC_MESSAGES/messages.mo
  93. 62
      searx/translations/sk/LC_MESSAGES/messages.po
  94. BIN
      searx/translations/sl/LC_MESSAGES/messages.mo
  95. 66
      searx/translations/sl/LC_MESSAGES/messages.po
  96. BIN
      searx/translations/sr/LC_MESSAGES/messages.mo
  97. 66
      searx/translations/sr/LC_MESSAGES/messages.po
  98. BIN
      searx/translations/sv/LC_MESSAGES/messages.mo
  99. 58
      searx/translations/sv/LC_MESSAGES/messages.po
  100. BIN
      searx/translations/szl/LC_MESSAGES/messages.mo
  101. Some files were not shown because too many files have changed in this diff Show More

9
docs/src/searx.plugins.tor_check.rst

@ -0,0 +1,9 @@
.. _tor check plugin:
================
Tor check plugin
================
.. automodule:: searx.plugins.tor_check
:members:

4
requirements-dev.txt

@ -14,10 +14,10 @@ sphinx-jinja==2.0.2
sphinx-tabs==3.4.1
sphinxcontrib-programoutput==0.17
sphinx-autobuild==2021.3.14
sphinx-notfound-page==0.8
sphinx-notfound-page==0.8.3
myst-parser==0.18.0
linuxdoc==20211220
aiounittest==1.4.2
yamllint==1.26.3
yamllint==1.27.1
wlc==1.13
coloredlogs==15.0.1

46
searx/data/engine_descriptions.json

@ -53,6 +53,7 @@
"currency:nl-BE",
"ref"
],
"emojipedia":"Emojipedia is een online naslagwerk voor emoji dat de betekenis en het gemeenschappelijk gebruik van emoji-tekens in de Unicode-Standaard documenteert. De site werd in 2013 opgestart door de Australiër Jeremy Burge.",
"tineye":"TinEye is een zoekmachine voor afbeeldingen. TinEye is eigendom van het in Canada gesitueerde bedrijf Idée, Inc. Met de webapplicatie TinEye kunnen gebruikers naar afbeeldingen zoeken. Afbeeldingen kunnen geüpload worden op de website van TinEye of door een URL in te voeren naar een bestaande afbeelding.",
"flickr":"Flickr is een website voor het delen van foto's en videofragmenten. Net als Delicious wordt het gezien als een Web 2.0-applicatie die tagging (trefwoorden) gebruikt om een niet-hiërarchische classificering mogelijk te maken (folksonomie).",
"free software directory":"De Free Software Directory is een website opgericht door de Free Software Foundation (FSF) en de UNESCO. Het biedt een overzicht van vrije software, met name software voor vrije besturingssystemen, zoals Linux en BSD. Voordat besloten wordt tot de opname van een programma in de Free Software Directory, wordt nagegaan of de aangeduide licentie wel degelijk de juiste licentie is.",
@ -118,6 +119,7 @@
"archive is":"archive.today又稱archive.is,是一個私人資助的網頁存檔網站,資料中心位於歐洲法國的北部-加來海峽。這個網站典藏檔案館使用Apache Hadoop與Apache Accumulo軟體。它可以一次取回一個類似於WebCite的小於50MB的頁面,並能收錄Google地圖與Twitter。",
"arxiv":"arXiv 是一個收集物理學、數學、計算機科學、生物學與數理經濟學的論文預印本的網站,始於1991年8月14日。截至2008年10月,arXiv.org已收集超過50萬篇預印本;至2014年底,藏量達到1百萬篇。截至2016年10月,提交率已達每月超過10,000篇。",
"bandcamp":"Bandcamp是一家美國線上音樂公司, 由前Oddpost聯合創始人Ethan Diamond與程序員Shawn Grunberger、Joe Holt和Neal Tucker於2008年創立,總部位於加利福尼亞。",
"wikipedia":"維基百科 是維基媒體基金會運營的一個多語言的線上百科全書,並以創建和維護作為開放式協同合作項目,特點是自由內容、自由編輯、自由版權。目前是全球網絡上最大且最受大眾歡迎的參考工具書,名列全球二十大最受歡迎的網站,其在搜尋引擎中排名亦較為靠前。維基百科目前由非營利組織維基媒體基金會負責營運。Wikipedia是混成詞,分別取自於網站核心技術「Wiki」以及英文中百科全書之意的「encyclopedia」。截至2021年初,所有語種的維基百科條目數量達5,500萬。",
"bing":"是一款由微軟公司推出的網路搜尋引擎。Bing的歷史可追溯至於1998年的第三個季度發布的MSN Search,它的由Looksmart和Inktomi等提供;2006年3月8日,微軟發布了Windows Live Search的公測版,並於同年9月11日讓其取代了MSN Search,該引擎開始使用搜尋選項卡;次年3月,微軟將其與Windows Live分開並更名Live Search,在此期間,其子服務曾經多次重組、關閉。到了2009年6月3日,微軟將Live Search改造成了今天的Bing並正式發布。微軟認為Bing一詞簡單明了、易於拼寫,容易被人記住;它源自成語「有求必應」。微軟聲稱,此款搜尋引擎將以全新的姿態面世並帶來革命。Bing的內測代號為Kumo,其後才被命名為Bing。2020年10月5日,Bing更名為Microsoft Bing。",
"bing images":[
"bing:zh-HK",
@ -126,6 +128,7 @@
"crossref":"Crossref (曾用名CrossRef)是國際DOI基金會 旗下的一個DOI注冊機構,它的成員來自2,000個不同的出版商。Crossref由Publishers International Linking Association Inc.負責運營。該機構於2000年初成立。",
"deezer":"Deezer是一家法國在線音樂流媒體服務提供商。它允許用戶在各種設備上在線或離線收聽來自包括環球音樂集團、索尼音樂和華納音樂集團在內的各家唱片公司的音樂。2007年,Deezer創建於法國巴黎,截至2019年1月,Deezer擁有5600萬首授權曲目,擁有超過3萬個電台頻道,月活躍用戶達1400萬,付費用戶為700萬。該服務適用於Web、Android、IOS、Windows Mobile、BlackBerry OS、Microsoft Windows和MacOS。",
"wikidata":"維基數據 是一個可協同編輯的知識庫,是繼2006年的維基學院之後,第一個新的維基媒體基金會項目。這一項目與維基共享資源的工作方式類似,將為其他維基計劃及各語種維基百科中的信息框、列表及跨語言連結等提供統一存放的數據,該項目在2012年10月30日投入使用。維基數據藉由軟體Wikibase運行。",
"emojipedia":"表情圖標百科 是一個表情圖標參考網站,記載了Unicode標准中各個表情圖標的編碼、含義、演變等信息。",
"etymonline":"在線詞源詞典 是免費的在線詞典,由道格拉斯·哈珀 編纂和撰寫,用於描述英語單詞的詞源。",
"fdroid":"F-Droid是一個Android應用程序的軟件資源庫(或應用商店);其功能類似於Google Play商店,但只包含自由及開放源代碼軟件。應用可從F-Droid網站或直接從F-Droid客戶端應用瀏覽及安裝,F-Droid客戶端應用會自動更新其應用。F-Droid不要求用戶注冊賬號。如果應用包含廣告、用戶分析器,追蹤器或倚賴非自由軟件,會被標記存在「負功能」(antifeatures)。運行F-Droid的服務器也均使用自由及開放源代碼軟件,從而允許任何人創建自己的軟件庫。",
"flickr":"Flickr為一家提供圖片分享的網路相簿,是Web 2.0的最佳利用例子之一。",
@ -225,6 +228,7 @@
"currency:ar",
"ref"
],
"emojipedia":"إيموجي بيديا هو موقع على الإنترنت مختص بمراجع الإيموجي، قام بإنشائه متخصص الإيموجي جيرمي بورج في 2013.",
"tineye":"تن آي هو محرك البحث للصور وهي خدمة أنشأتها شركة مقرها في تورونتو كندا. حيث يقوم المستخدم بإرسال الصورة الي الموقع لكي يقوم محرك بالبحث عن مصدرها.",
"etymonline":"قاموس علم اشتقاق الألفاظ هو قاموس حر على الانترنت يصف أصول الكلمات باللغة الإنجليزية.",
"fdroid":"إف-درويد هو مستودع برامج أو \"متجر تطبيقات\" لتطبيقات الأندرويد، مماثل ومشابه ل جوجل بلاي ستور . المستودع الرئيسي مستضاف من طرف مشروع يحتوي فقط على تطبيقات ذات برامج حرة أو مفتوحة المصدر. التطبيقات يمكن تصفحها وتحميلها من الموقع الرسمي ل إف-درويد بدون حاجة المستخدم إلى تسجيل أو فتح حساب. «مضاد الميزات» على غرار الإعلانات تستعمل التتبع أو أنها تعتمد على برامج غير حرة ويتم ذكر هذا في الوصف. يقدم الموقع أيضا مصدر الكود للتطبيقات ، حيث أن مضيفي البرامج يستعملون خادم ف-درويد، وبالتالي يسمحون لأي شخص من المجموعة في أن يصبح ملك تطبيق معين في المستودع.",
@ -404,7 +408,7 @@
"reddit":"রিট একটিিক নটওযক সহতি, ওযব বিষযবসি, এব আলচনর ওযবসইট। নিবনিত সদসযরিিন কনট যমনিক, লি, এব ছবি জমি, য পর অনয সদসযদর ভ উপর উঠি। রিট এক বিরমযকলন যর হগ রয, য বল হয “সবরিট”। বি আপভট পওযবমিশনগর সবরির উপরর দি কর এব যদি যথট পরিণ ভট প তবষ পরযনত সইটর পরথম প কর।",
"soundcloud":"সউনডকউড হল জির রজধিন-এ সিত একটি অনলইন অডিও বণটন ভিিক পরচর মযম, যিযবহরকর নিব তত শবদ ব সঙত আপলড, রকরড, এর উনতকরণ এব সবর উদরচর অধির পরদন কর।",
"startpage":"সটপজ হল গপনিভর সচ ইঞিন। এটি আগচ এব আইএকসকইক নিন দিচ ইঞিন ছিল। ২০১৬ সিি একত হয। প এটি আইএকস কইক অনসনন ইঞিন ন পরিিত ছি।",
"youtube":"ইউটিউব হলন ব, কিিিিক একটিিন অনলইন ভিিির সইট, য ২০০৫ সর ফিরকিত হয। ২০০৬ সর অকবর, গগল সইটটি ১.৬৫ বিিন মিন ডলর বিিমযরয কর। ইউটিউব বরতমগলর অনযতম অধনসথ পরতিন হি পরিিত হচ।",
"youtube":"ইউটিউব হলন ব, কিিিিক একটিিন অনলইন ভিিটফরর সইট, য ২০০৫ সর ফিরকিত হয। ইউটিউব বরতমবপণ একটিটফর। ২০০৬ সর অকবর, গগল সইটটি ১.৬৫ বিিন মিন ডলর বিিমযরয কর। ইউটিউব বরতমগলর অনযতম অধনসথ পরতিন হি পরিিত হচ।",
"wikibooks":"উইকিবই হল উইকি-ভিিক পরির একটি উইকিিিরকলপ যিিউইকি সফটওযর মযমিত এব উইকিিিউনশন করক হটকত। এটি একটিরকলপ, যিিন পরকর পযপতক পঠনযয আকরকষণ কর হয।",
"wikinews":"উইকিিউজ ব উইকিদ হল উইকিত বিষযবসর আল পরিিত সদ বিষযক ওযবসইট এব উইকিিিউনশনর একটিরকলপ যিবব সহযিলক সিকতর মযমজ কর। উইকিিির সহ-পরতিিি ওযলস উইকিিি উইকিদ আল করর পরসঙ বলন, \"উইকি, পরতিি গলপ বিবকিবনধ থিন আঙিলত একটিদ হি হব।\" উইকিদ নিরপষ দিভঙিি অনসরণর মযমিকত বসিঠতর ধরণরতি কর অনয নগরিক সিকত চরর ওযবসইট যমন, ইনিি ও ওহমইনিউজ থিনতর।",
"wikiquote":"উইকিউকি উইকি-ভিিক পরির একটিরকলপ যিিউইকি সফটওযর মযমিত এব উইকিিিউনশন করক পরিিত। এটিিল অলসটনর ধরণর উপর ভিি কর এবিন ভির করক বতবিত। উইকিউকিসমহ উইকিিির উলখযয বযকিব সমপরিবনরস-সত কর হয।",
@ -777,6 +781,7 @@
"currency:de",
"ref"
],
"emojipedia":"Die Emojipedia ist ein englischsprachiges Online-Nachschlagewerk für Emojis. Sie wurde am 14. Juli 2013 vom australischen Emoji-Experten Jeremy Burge gegründet und ist die führende Ressource zu Emojis im Internet.",
"tineye":"Idée Inc. ist ein als Aktiengesellschaft eingetragenes Unternehmen aus Toronto, das Bildidentifizierungs- und Suchsoftware entwickelt und anbietet. Das Unternehmen gilt als einer der Pioniere in der Bildüberwachungsindustrie.",
"fdroid":"F-Droid ist ein alternativer App Store für das mobile Betriebssystem Android. Die Besonderheit von F-Droid besteht darin, dass im offiziellen und standardmäßig aktivierten Repository ausschließlich freie Software angeboten wird, üblicherweise nach GNU GPL oder Apache-Lizenz. Der Quellcode jeder App im F-Droid-Repositorium steht nicht nur dem Endnutzer zur Einsichtnahme und Modifikation zur Verfügung, sondern es wird auch garantiert, dass die heruntergeladene apk-Datei vom F-Droid-Server aus diesen Quellen generiert wurde. Entsprechend ist diese Datei auch von F-Droid signiert und nicht wie üblich vom ursprünglichen Entwickler. Dieses Konzept soll für Transparenz und Sicherheit sorgen.",
"flickr":"Flickr ist ein kommerzieller Onlinedienst mit Community-Elementen, der es Benutzern erlaubt, digitale und digitalisierte Bilder sowie kurze Videos von maximal zehn Minuten Dauer mit Kommentaren und Notizen auf die Website zu laden und so anderen Nutzern zugänglich zu machen. Neben dem herkömmlichen Hochladen über die Website können die Bilder auch per E-Mail oder vom Mobiltelefon aus übertragen und später von anderen Webauftritten aus verlinkt werden.",
@ -801,7 +806,7 @@
"ref"
],
"hoogle":"Haskell ist eine rein funktionale Programmiersprache, benannt nach dem US-amerikanischen Mathematiker Haskell Brooks Curry, dessen Arbeiten zur mathematischen Logik eine Grundlage funktionaler Programmiersprachen bilden. Haskell basiert auf dem Lambda-Kalkül, weshalb auch der griechische Buchstabe Lambda als Logo verwendet wird. Die wichtigste Implementierung ist der Glasgow Haskell Compiler (GHC).",
"imdb":"Die Internet Movie Database ist eine Datenbank zu Filmen, Fernsehserien, Videoproduktionen und Computerspielen sowie über Personen, die daran mitgewirkt haben. Im Januar 2020 gab es Einträge zu über 7,55 Millionen Filmproduktionen und zu über 11,21 Millionen Film- und Fernsehschaffenden. Betrieben wird die Datenbank seit 1998 von Amazon.",
"imdb":"Die Internet Movie Database ist eine US-amerikanische Datenbank zu Filmen, Fernsehserien, Videoproduktionen und Computerspielen sowie über Personen, die daran mitgewirkt haben. Im Januar 2020 gab es Einträge zu über 7,55 Millionen Filmproduktionen und zu über 11,21 Millionen Film- und Fernsehschaffenden. Betrieben wird die Datenbank seit 1998 von Amazon.",
"ina":"Das Institut national de l’audiovisuel (INA) ist ein öffentlich-rechtliches französisches Unternehmen. Das INA war das erste digitalisierte Archiv Europas. Sein Auftrag ist es, alle französischen Rundfunk- und Fernsehproduktionen zu sammeln, zu bewahren und öffentlich zugänglich zu machen, in etwa vergleichbar dem Auftrag der Bibliothèque nationale de France (BnF), geschriebene und gedruckte Dokumente aller Art zu archivieren. Die Sammlungen des INA sind über seine Website für die Öffentlichkeit teilweise kostenlos zugänglich, der Rest unterliegt urheberrechtlichen Beschränkungen.",
"invidious":[
"alternatives Frontend für YouTube",
@ -984,7 +989,7 @@
"Arch Linux documentation on the web",
"wikidata"
],
"archive is":"archive.today is a web archiving site, founded in 2012, that saves snapshots on demand, and has support for JavaScript-heavy sites such as Google Maps and progressive web applications such as Twitter. Archive.today records two snapshots: one replicates the original webpage including any functional live links; the other is binary image screenshot of the page.",
"archive is":"archive.today is a web archiving site, founded in 2012, that saves snapshots on demand, and has support for JavaScript-heavy sites such as Google Maps and progressive web applications such as Twitter. archive.today records two snapshots: one replicates the original webpage including any functional live links; the other is a screenshot of the page.",
"artic":"The Art Institute of Chicago in Chicago's Grant Park, founded in 1879, is one of the oldest and largest art museums in the world. Recognized for its curatorial efforts and popularity among visitors, the museum hosts approximately 1.5 million people annually. Its collection, stewarded by 11 curatorial departments, is encyclopedic, and includes iconic works such as Georges Seurat's A Sunday on La Grande Jatte, Pablo Picasso's The Old Guitarist, Edward Hopper's Nighthawks, and Grant Wood's American Gothic. Its permanent collection of nearly 300,000 works of art is augmented by more than 30 special exhibitions mounted yearly that illuminate aspects of the collection and present cutting-edge curatorial and scientific research.",
"arxiv":"arXiv is an open-access repository of electronic preprints and postprints approved for posting after moderation, but not peer review. It consists of scientific papers in the fields of mathematics, physics, astronomy, electrical engineering, computer science, quantitative biology, statistics, mathematical finance and economics, which can be accessed online. In many fields of mathematics and physics, almost all scientific papers are self-archived on the arXiv repository before publication in a peer-reviewed journal. Some publishers also grant permission for authors to archive the peer-reviewed postprint. Begun on August 14, 1991, arXiv.org passed the half-million-article milestone on October 3, 2008, and had hit a million by the end of 2014. As of April 2021, the submission rate is about 16,000 articles per month.",
"bandcamp":"Bandcamp is an American online audio distribution platform founded in 2007 by Oddpost co-founder Ethan Diamond and programmers Shawn Grunberger, Joe Holt and Neal Tucker, with headquarters in Oakland, California, US.",
@ -1032,6 +1037,7 @@
"currency:en",
"ref"
],
"emojipedia":"Emojipedia is an emoji reference website which documents the meaning and common usage of emoji characters in the Unicode Standard. Most commonly described as an emoji encyclopedia or emoji dictionary, Emojipedia also publishes articles and provides tools for tracking new emoji characters, design changes and usage trends. It is owned by Zedge since 2021.",
"tineye":"TinEye is a reverse image search engine developed and offered by Idée, Inc., a company based in Toronto, Ontario, Canada. It is the first image search engine on the web to use image identification technology rather than keywords, metadata or watermarks. TinEye allows users to search not using keywords but with images. Upon submitting an image, TinEye creates a \"unique and compact digital signature or fingerprint\" of the image and matches it with other indexed images. This procedure is able to match even heavily edited versions of the submitted image, but will not usually return similar images in the results.",
"etymonline":"The Online Etymology Dictionary is a free online dictionary, written and compiled by Douglas R. Harper, that describes the origins of English-language words.",
"1x":[
@ -1150,7 +1156,7 @@
"A search engine of PeerTube videos, channels and playlists, developed by Framasoft",
"https://sepiasearch.org"
],
"soundcloud":"SoundCloud is an online audio distribution platform and music sharing website that enables its users to upload, promote, and share audio, as well as a digital signal processor enabling listeners to stream audio. Founded in 2007 by Alexander Ljung and Eric Wahlforss, SoundCloud has grown to be one of the largest music streaming services in the world and is available in 190 countries and territories. Audience-wise, there are over 76 million active monthly users, with over 175 million global users that SoundCloud reaches, as of November 2021. While its competitors report having roughly 70 million tracks in their systems, SoundCloud supersedes this with over 300 million. SoundCloud offers both free and paid memberships on the platform, available for mobile, desktop and Xbox devices.",
"soundcloud":"SoundCloud is an online audio distribution platform and music sharing website that enables its users to upload, promote, and share audio, as well as a digital signal processor enabling listeners to stream audio. Founded in 2007 by Alexander Ljung and Eric Wahlforss, SoundCloud has grown to be one of the largest music streaming services in the world and is available in 190 countries and territories. Audience-wise, there are over 76 million active monthly users, with over 175 million global users that SoundCloud reaches, as of November 2021. While its competitors report having roughly 70 million tracks in their systems, SoundCloud has over 300 million. SoundCloud offers both free and paid memberships on the platform, available for mobile, desktop and Xbox devices.",
"stackoverflow":"Stack Exchange is a network of question-and-answer (Q&A) websites on topics in diverse fields, each site covering a specific topic, where questions, answers, and users are subject to a reputation award process. The reputation system allows the sites to be self-moderating. As of August 2019, the three most actively-viewed sites in the network are Stack Overflow, Super User, and Ask Ubuntu.",
"askubuntu":[
"stackoverflow:en",
@ -1225,7 +1231,7 @@
"wikidata"
],
"brave":"Brave Search is a search engine developed by Brave Software, Inc. and is set as the default search engine for Brave browser users in certain countries.",
"petalsearch":"Petal Search is a search engine, developed by Huawei in the second half of 2020, it is available on mobile and desktop platforms. Inspired by Huaweis logo, the search engine was named Petal as in flower petals.",
"petalsearch":"Petal Search is a worldwide search engine, developed by Huawei in the second half of 2020, it is available on mobile and desktop platforms. Inspired by Huawei's logo, the search engine was named Petal as in flower petals.",
"petalsearch images":[
"petalsearch:en",
"ref"
@ -1373,7 +1379,7 @@
"gitlab":"Gitlab Inc. es una compañía de núcleo abierto y es la principal proveedora del software GitLab, un servicio web de forja, control de versiones y DevOps basado en Git. Además de gestor de repositorios, el servicio ofrece también alojamiento de wikis y un sistema de seguimiento de errores, todo ello publicado bajo una licencia de código abierto, principalmente.",
"github":"GitHub es una forja para alojar proyectos utilizando el sistema de control de versiones Git. Se utiliza principalmente para la creación de código fuente de programas de ordenador. El software que opera GitHub fue escrito en Ruby on Rails. Desde enero de 2010, GitHub opera bajo el nombre de GitHub, Inc. Anteriormente era conocida como Logical Awesome LLC. El código de los proyectos alojados en GitHub se almacena generalmente de forma pública.",
"google":"El buscador de Google o buscador web de Google es un motor de búsqueda en la web propiedad de Alphabet Inc. Es el motor de búsqueda más utilizado en la Web y recibe cientos de millones de consultas cada día a través de sus diferentes servicios. El objetivo principal del buscador de Google es buscar texto en las páginas web, en lugar de otro tipo de datos. Fue desarrollado originalmente por Larry Page y Sergey Brin en 1997.",
"google images":"Google Imágenes es una especialización del buscador principal para imágenes, que fue implementado en el año 2001. Contiene en su interfaz distintas herramientas de búsqueda, que sirven para filtrar los resultados de las imágenes. Estos pueden ser según su tamaño, tipo, formatos, por coloración, por color, por fecha, y por imágenes similares.",
"google images":"Google Imágenes es una especialización del buscador principal para imágenes, se introdujo el 12 de julio de 2001 debido a la demanda de imágenes del vestido verde de Versace que usó Jennifer López en febrero de 2000. En 2011, se agregó la función de búsqueda inversa de imágenes.",
"google news":"Google Noticias, conocido en España como Google News, es un agregador y buscador de noticias automatizado que rastrea de forma constante la información de los principales medios de comunicación en línea.",
"google videos":"Google Videos fue un servicio de Google que hasta enero de 2009 permitía subir clips de video a sus servidores para que cualquier persona los pudiera buscar y ver directamente desde su navegador. Inicialmente nació como competencia de YouTube, a la que terminó comprando el 10 de octubre de 2006. Finalmente, Google Video pasó a funcionar como un mero buscador de vídeos en la red, pasando a ser YouTube el único servicio de estos dos que permite la subida de vídeos.",
"google scholar":"Google Académico es un motor de búsqueda de Google enfocado y especializado en la búsqueda de contenido y bibliografía científico-académica. El sitio indexa editoriales, bibliotecas, repositorios, bases de datos bibliográficas, entre otros; y entre sus resultados se pueden encontrar citas, enlaces a libros, artículos de revistas científicas, comunicaciones y congresos, informes científico-técnicos, tesis, tesinas y archivos depositados en repositorios.",
@ -1884,7 +1890,7 @@
"piratebay":"The Pirate Bay est un site web créé en 2003 en Suède, indexant des liens Magnets de fichiers numériques, permettant le partage de fichiers en pair à pair à l’aide du protocole de communication BitTorrent. Le site se finance par les dons et la publicité, il a été créé dans l’esprit d’une « culture libre ».",
"pubmed":"MEDLINE est une base de données bibliographiques regroupant la littérature relative aux sciences biologiques et biomédicales. La base est gérée et mise à jour par la Bibliothèque américaine de médecine (NLM).",
"pypi":"PyPI est le dépôt tiers officiel du langage de programmation Python. Son objectif est de doter la communauté des développeurs Python d'un catalogue complet recensant tous les paquets Python libres. Il est analogue au dépôt CPAN pour Perl.",
"qwant":"Qwant est un moteur de recherche français. Mis en ligne le 16 février 2013 en version bêta, puis en version définitive le 4 juillet 2013, il annonce depuis son lancement ne pas tracer ses utilisateurs, ni vendre leurs données personnelles, afin de garantir leur vie privée, et se veut neutre dans l'affichage des résultats. Dans les faits, des données sont cependant partagées avec Microsoft.",
"qwant":"Qwant est un moteur de recherche français. Mis en ligne le 16 février 2013 en version bêta, puis en version définitive le 4 juillet 2013, il annonce depuis son lancement[citation nécessaire] ne pas tracer ses utilisateurs, ni vendre leurs données personnelles, afin de garantir leur vie privée, et se veut neutre dans l'affichage des résultats. Dans les faits, des données sont cependant partagées avec Microsoft.",
"qwant news":[
"qwant:fr",
"ref"
@ -2027,6 +2033,7 @@
"currency:he",
"ref"
],
"emojipedia":"אמוג'יפדיה הוא אתר אנציקלופדי המבוסס על אמוג'ים, שנוצר על ידי ג'רמי בורג בשנת 2013. האתר אחראי לשינוי ולחידוש הסמלים, האמוג'ים ומשמעותם על פי תקן יוניקוד. האתר משתייך לארגונים המשתפים פעולה בעניינים כלכליים-חברתיים ומכונה \"משאב האמוג'י מספר אחת בעולם\".",
"fdroid":[
"מאגר של תכניות חופשיות ל־Android",
"wikidata"
@ -2550,7 +2557,7 @@
"https://www.bing.com/news"
],
"bing videos":[
"Bing을 사용하면 정보를 기반으로 작업을 수행할 수 있고 검색에서 작업 수행까지 더 빠르고 쉽게 진행할 수 있습니다.",
"Bing 可協助您將資訊轉化為行動,從開始搜尋到採取行動更快、更輕鬆。",
"https://www.bing.com/videos"
],
"bitbucket":"빗버킷(Bitbucket)은 아틀라시안 소유의 웹 기반 버전 관리 저장소 호스팅 서비스로서, 깃(2011년 10월 이후) 버전 관리 시스템을 사용하는 소스 코드 및 개발 프로젝트를 대상으로 한다. 빗버킷은 상용 플랜과 무료 계정을 동시에 제공한다. 2010년 9월 기준으로 무료 계정의 경우 무제한 수의 개인 저장소(무료 계정의 경우 최대 5명의 사용자 보유 가능)를 제공한다. 빗버킷은 지라, 힙챗, 컨플루언스, 밤부 등의 기타 아틀라시안 소프트웨어와 연동된다.",
@ -2862,6 +2869,10 @@
"currency:en",
"ref"
],
"emojipedia":[
"emojipedia:en",
"ref"
],
"tineye":[
"tineye:en",
"ref"
@ -3256,6 +3267,10 @@
"currency:nl-BE",
"ref"
],
"emojipedia":[
"emojipedia:nl-BE",
"ref"
],
"tineye":[
"tineye:nl-BE",
"ref"
@ -3638,10 +3653,6 @@
"ref"
],
"openstreetmap":"OpenStreetMap (OSM) é um projeto de mapeamento colaborativo para criar um mapa livre e editável do mundo, inspirado por sites como a Wikipédia. Traduzindo para português o nome significa Mapa Aberto de Ruas. Ele fornece dados a centenas de sites na internet, aplicações de celular e outros dispositivos.",
"pdbe":[
"PDBe home < Node < EMBL-EBI",
"https://www.ebi.ac.uk/pdbe"
],
"piratebay":"The Pirate Bay (TPB), autointitulado \"O tracker BitTorrent mais resiliente da galáxia\", contém magnet links, sendo também o índice para os arquivos .torrent. Um magnet link ou um arquivo .torrent, em conjunto com um cliente BitTorrent, proporciona ao cliente as informações necessárias para se copiar um arquivo ou conjunto de arquivos de outras pessoas que estão copiando ou compartindo o mesmo arquivo.",
"pubmed":"MEDLINE® é uma sigla em inglês para Sistema Online de Busca e Análise de Literatura Médica é a base de dados bibliográficos da Biblioteca Nacional de Medicina dos Estados Unidos da América. Contém mais de 18 milhões de referências a artigos de jornais científicos, com maior concentração em biomedicina, mas contém também artigos sobre enfermagem, veterinária, farmacologia, odontologia, entre outros. Uma característica marcante da MEDLINE é que os dados gravados no sistema são indexados com palavras-chave específicas de um sistema chamado MeSH.",
"pypi":"O Python Package Index, abreviado como PyPI e também conhecido como Cheese Shop, é o repositório de software oficial de terceiros para Python. É análogo ao CPAN, o repositório para Perl. Alguns gerenciadores de pacotes, incluindo o pip, usam o PyPI como a fonte padrão para os pacotes e suas dependências. Mais de 113.000 pacotes Python podem ser acessados por meio do PyPI.",
@ -4384,6 +4395,7 @@
"currency:sv",
"ref"
],
"emojipedia":"Emojipedia är ett digitalt lexikon för emojier. Lexikonet dokumenterar alla emojier som finns i standarden Unicode och deras betydelse. Emojipedia har kallats för världens främsta resurs om emojier.",
"etymonline":"Online Etymology Dictionary är en nätbaserad engelskspråkig etymologisk ordbok, framtagen och publicerad 2001 av historikern Douglas R. Harper.",
"fdroid":[
"pakethanterare som innehåller fri programvara samt open source för Android plattformen",
@ -4440,7 +4452,7 @@
},
"ta":{
"artic":"ஆர இனி ஆபி எனபத ஐகிய அமிிி நகரி அமள கலகளஞிய அரியகம ஆக. இவவரியகமிகபிரமடமன ம கடடடஙகளி இயஙிறத. இம கடடடஙகளதல தளதடன இணகபபடளன.",
"wikipedia":"விிி எனபத, வணிக நகறற விிிிவனதி உதவிடன நடததபபட, ககதகபபட, பனி, கடடறற இணயக கலகளஞியம. தமிிிிி 1,00,000கபடட கடகளடன இதனதக கடகளன 24 மிியன கடகள உலகிள தனவலரகளக எழதபபடிறன. ப இதன எல கடகள, இதன பயனபட எவர, தகபபடகவன. ம இதிடததடட 100,000 மன பஙகளிளரகளளத. ச 2022 வரி, விிி 285 மிகளியறபடிறத. இத இணயததளதி இயங உச பகிகளிிகவியத, அதிகபகழறத. ம, இத அல இணயததளதிணபபட இணயததளஙகளி தரவரிி ஆறவத இடதி உளளத, உலகளவி அணணளவக 365 மிியனசகரகளளத.",
"wikipedia":"விிி எனபத, வணிக நகறற விிிிவனதி உதவிடன நடததபபட, ககதகபபட, பனி, கடடறற இணயக கலகளஞியம. தமிிிிி 1,00,000கபடட கடகளடன இதனதக கடகளன 24 மிியன கடகள உலகிள தனவலரகளக எழதபபடிறன. ப இதன எல கடகள, இதன பயனபட எவர, தகபபடகவன. ம இதிடததடட 100,000 மன பஙகளிளரகளளத. ச 2022 வரி, விிி 285 மிகளியறபடிறத. இத இணயததளதி இயங உச பகிகளிிகவியத, அதிகபகழறத. ம, இத அல இணயததளதிணபபட இணயததளஙகளி தரவரிி ஆறவத இடதி உளளத, உலகளவி அணணளவக 365 மிியனசகரகளளத.",
"bing":"பி (Bing) எனபதிவதிதமன வலடலி ஆக. இதடலினதனர, வி, எமஎஸஎன ஆகிய பயரகள அமிதத. இதடலிிவனதிிிக விளமபரபபடதபபடடத. 2009 ஆம ஆணதம 28 ஆமிகதியனி நகரி இடமற ஆலிிிடல (All Things Digital) மிிவனதி தலிக அதிி இசமர இதடலி அறிகபபடதபபட 1 இலிிடபபட எனவ அறிிகபபடடத.. 2009 ஆம ஆண, 29 ஆமிகதியன! தடலிிிடலிிவகி என அறிிகபபடடத.",
"bing images":[
"bing:ta",
@ -4530,10 +4542,6 @@
],
"imdb":"ఇటరిలకిిిన ఒక వ. ఇదిిి, TV ష, నట, సిక నిల వివరలతిన అతిద ఆన సమర నిి (డ). ఇదిరస Amazon.com సథ ఆధవర నడి. ఇది ఉనన ఏకక భష ఆ.",
"library of congress":"పరపి అతిద గలయరర ఆఫ, విటన, డి.సి. లిిటలిన సి. ఇది 1800వ సవతసర ఏపి 24న సితమి.",
"openstreetmap":[
"OpenStreetMap is the free wiki world map.",
"https://www.openstreetmap.org/"
],
"youtube":"య అనితరిలన ఇతరలతవడికలి ఒక అతరయ సవ. దిరధన కలయ అమిి, కిి, శ అన నగరి.",
"wikibooks":"వినకలహకలత సమషి తయయగల పతకల జల సథలి. ఇది 2004 ఆగస 13న పభమి. విలనిిఅతితకవ వసప ఉని. ది ఉబకరిగదరిిిబడిన పతక. ది ఉబయడ దగగరని, ఉతతరమట, పరదరశన పతరమట, విిధ రకల ధవని, దయ శరవణ మయమమలన నడట, వడబడిహరిివన ఎలయవచివరిచటమనది. ఇట పతకిచబడిి. విడవలసిన కిరపన విిచబడినవి. ఈ పరధన ఉదయపతక సమషిియట. ఏపి 2010 అలకల పరకరపిలసథలలనిి 2,462వ సనమఉననది.",
"wikiquote":"వి అనగియ .విిషన ఆధవరయమిి నడిి ఆధిత పబమ ఒక ప. డియల ఆలటనక ఆలచననరయనిబరచరణలటగిన ఈ పక లక సమిి సమనవయ కిిిధ పరమఖ వయక, పతక, సతలనికరిిన వయల యక విత వనర తయిిిిిన వివరపరచడ. అనక అనయల సకరణల ఉననపపటిదరశకలనకరణ పరకియల అవకశమ ఇసన అతిిిియ ఒకటిిిఠత సినది.",
@ -4847,8 +4855,8 @@
"ref"
],
"bing videos":[
"Bing 可協助您將資訊轉化為行動,從開始搜尋到採取行動更快、更輕鬆。",
"https://www.bing.com/videos"
"bing videos:ko",
"ref"
],
"crossref":"Crossref (曾用名CrossRef)是國際DOI基金會 旗下的一個DOI注册机构,它的成員來自2,000個不同的出版商。Crossref由Publishers International Linking Association Inc.負責运营。該機構于2000年初成立。",
"deezer":"Deezer是一家法国在线音乐流媒体服务提供商。它允许用户在各种设备上在线或离线收听来自包括环球音乐集团、索尼音乐和华纳音乐集团在內的各家唱片公司的音乐。2007年,Deezer创建于法国巴黎,截至2019年1月,Deezer拥有5600万首授权曲目,拥有超过3万个电台频道,月活跃用户達1400万,付费用户為700万。该服务适用于Web、Android、IOS、Windows Mobile、BlackBerry OS、Microsoft Windows和MacOS。",

49
searx/engines/bing.py

@ -8,7 +8,8 @@
import re
from urllib.parse import urlencode, urlparse, parse_qs
from lxml import html
from searx.utils import eval_xpath, extract_text, match_language
from searx.utils import eval_xpath, extract_text, eval_xpath_list, match_language
from searx.network import multi_requests, Request
about = {
"website": 'https://www.bing.com',
@ -79,30 +80,48 @@ def response(resp):
dom = html.fromstring(resp.text)
for result in eval_xpath(dom, '//div[@class="sa_cc"]'):
# IMO //div[@class="sa_cc"] does no longer match
logger.debug('found //div[@class="sa_cc"] --> %s', result)
link = eval_xpath(result, './/h3/a')[0]
url = link.attrib.get('href')
title = extract_text(link)
content = extract_text(eval_xpath(result, './/p'))
# append result
results.append({'url': url, 'title': title, 'content': content})
# parse results again if nothing is found yet
for result in eval_xpath(dom, '//li[@class="b_algo"]'):
url_to_resolve = []
url_to_resolve_index = []
for i, result in enumerate(eval_xpath_list(dom, '//li[@class="b_algo"]')):
link = eval_xpath(result, './/h2/a')[0]
url = link.attrib.get('href')
title = extract_text(link)
content = extract_text(eval_xpath(result, './/p'))
# get the real URL either using the URL shown to user or following the Bing URL
if url.startswith('https://www.bing.com/ck/a?'):
url_cite = extract_text(eval_xpath(result, './/div[@class="b_attribution"]/cite'))
# Bing can shorten the URL either at the end or in the middle of the string
if (
url_cite.startswith('https://')
and '' not in url_cite
and '...' not in url_cite
and '' not in url_cite
):
# no need for an additional HTTP request
url = url_cite
else:
# resolve the URL with an additional HTTP request
url_to_resolve.append(url.replace('&ntb=1', '&ntb=F'))
url_to_resolve_index.append(i)
url = None # remove the result if the HTTP Bing redirect raise an exception
# append result
results.append({'url': url, 'title': title, 'content': content})
# resolve all Bing redirections in parallel
request_list = [
Request.get(u, allow_redirects=False, headers=resp.search_params['headers']) for u in url_to_resolve
]
response_list = multi_requests(request_list)
for i, redirect_response in enumerate(response_list):
if not isinstance(redirect_response, Exception):
results[url_to_resolve_index[i]]['url'] = redirect_response.headers['location']
# get number_of_results
try:
result_len_container = "".join(eval_xpath(dom, '//span[@class="sb_count"]//text()'))
if "-" in result_len_container:

67
searx/engines/emojipedia.py

@ -0,0 +1,67 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
"""Emojipedia
Emojipedia is an emoji reference website which documents the meaning and
common usage of emoji characters in the Unicode Standard. It is owned by Zedge
since 2021. Emojipedia is a voting member of The Unicode Consortium.[1]
[1] https://en.wikipedia.org/wiki/Emojipedia
"""
from urllib.parse import urlencode
from lxml import html
from searx.utils import (
eval_xpath_list,
eval_xpath_getindex,
extract_text,
)
about = {
"website": 'https://emojipedia.org',
"wikidata_id": 'Q22908129',
"official_api_documentation": None,
"use_official_api": False,
"require_api_key": False,
"results": 'HTML',
}
categories = []
paging = False
time_range_support = False
base_url = 'https://emojipedia.org'
search_url = base_url + '/search/?{query}'
def request(query, params):
params['url'] = search_url.format(
query=urlencode({'q': query}),
)
return params
def response(resp):
results = []
dom = html.fromstring(resp.text)
for result in eval_xpath_list(dom, "/html/body/div[2]/div[1]/ol/li"):
extracted_desc = extract_text(eval_xpath_getindex(result, './/p', 0))
if 'No results found.' in extracted_desc:
break
link = eval_xpath_getindex(result, './/h2/a', 0)
url = base_url + link.attrib.get('href')
title = extract_text(link)
content = extracted_desc
res = {'url': url, 'title': title, 'content': content}
results.append(res)
return results

128
searx/network/__init__.py

@ -8,7 +8,8 @@ import concurrent.futures
from queue import SimpleQueue
from types import MethodType
from timeit import default_timer
from typing import Iterable, Tuple
from typing import Iterable, NamedTuple, Tuple, List, Dict, Union
from contextlib import contextmanager
import httpx
import anyio
@ -48,9 +49,23 @@ def get_context_network():
return THREADLOCAL.__dict__.get('network') or get_network()
def request(method, url, **kwargs):
"""same as requests/requests/api.py request(...)"""
@contextmanager
def _record_http_time():
# pylint: disable=too-many-branches
time_before_request = default_timer()
start_time = getattr(THREADLOCAL, 'start_time', time_before_request)
try:
yield start_time
finally:
# update total_time.
# See get_time_for_thread() and reset_time_for_thread()
if hasattr(THREADLOCAL, 'total_time'):
time_after_request = default_timer()
THREADLOCAL.total_time += time_after_request - time_before_request
def _get_timeout(start_time, kwargs):
# pylint: disable=too-many-branches
# timeout (httpx)
if 'timeout' in kwargs:
@ -65,45 +80,84 @@ def request(method, url, **kwargs):
# ajdust actual timeout
timeout += 0.2 # overhead
start_time = getattr(THREADLOCAL, 'start_time', time_before_request)
if start_time:
timeout -= default_timer() - start_time
# raise_for_error
check_for_httperror = True
if 'raise_for_httperror' in kwargs:
check_for_httperror = kwargs['raise_for_httperror']
del kwargs['raise_for_httperror']
return timeout
# requests compatibility
if isinstance(url, bytes):
url = url.decode()
# network
network = get_context_network()
# do request
future = asyncio.run_coroutine_threadsafe(network.request(method, url, **kwargs), get_loop())
try:
response = future.result(timeout)
except concurrent.futures.TimeoutError as e:
raise httpx.TimeoutException('Timeout', request=None) from e
# requests compatibility
# see also https://www.python-httpx.org/compatibility/#checking-for-4xx5xx-responses
response.ok = not response.is_error
# update total_time.
# See get_time_for_thread() and reset_time_for_thread()
if hasattr(THREADLOCAL, 'total_time'):
time_after_request = default_timer()
THREADLOCAL.total_time += time_after_request - time_before_request
# raise an exception
if check_for_httperror:
raise_for_httperror(response)
return response
def request(method, url, **kwargs):
"""same as requests/requests/api.py request(...)"""
with _record_http_time() as start_time:
network = get_context_network()
timeout = _get_timeout(start_time, kwargs)
future = asyncio.run_coroutine_threadsafe(network.request(method, url, **kwargs), get_loop())
try:
return future.result(timeout)
except concurrent.futures.TimeoutError as e:
raise httpx.TimeoutException('Timeout', request=None) from e
def multi_requests(request_list: List["Request"]) -> List[Union[httpx.Response, Exception]]:
"""send multiple HTTP requests in parallel. Wait for all requests to finish."""
with _record_http_time() as start_time:
# send the requests
network = get_context_network()
loop = get_loop()
future_list = []
for request_desc in request_list:
timeout = _get_timeout(start_time, request_desc.kwargs)
future = asyncio.run_coroutine_threadsafe(
network.request(request_desc.method, request_desc.url, **request_desc.kwargs), loop
)
future_list.append((future, timeout))
# read the responses
responses = []
for future, timeout in future_list:
try:
responses.append(future.result(timeout))
except concurrent.futures.TimeoutError:
responses.append(httpx.TimeoutException('Timeout', request=None))
except Exception as e: # pylint: disable=broad-except
responses.append(e)
return responses
class Request(NamedTuple):
"""Request description for the multi_requests function"""
method: str
url: str
kwargs: Dict[str, str] = {}
@staticmethod
def get(url, **kwargs):
return Request('GET', url, kwargs)
@staticmethod
def options(url, **kwargs):
return Request('OPTIONS', url, kwargs)
@staticmethod
def head(url, **kwargs):
return Request('HEAD', url, kwargs)
@staticmethod
def post(url, **kwargs):
return Request('POST', url, kwargs)
@staticmethod
def put(url, **kwargs):
return Request('PUT', url, kwargs)
@staticmethod
def patch(url, **kwargs):
return Request('PATCH', url, kwargs)
@staticmethod
def delete(url, **kwargs):
return Request('DELETE', url, kwargs)
def get(url, **kwargs):

25
searx/network/network.py

@ -13,6 +13,7 @@ import httpx
from searx import logger, searx_debug
from .client import new_client, get_loop, AsyncHTTPTransportNoHttp
from .raise_for_httperror import raise_for_httperror
logger = logger.getChild('network')
@ -226,6 +227,27 @@ class Network:
kwargs['follow_redirects'] = kwargs.pop('allow_redirects')
return kwargs_clients
@staticmethod
def extract_do_raise_for_httperror(kwargs):
do_raise_for_httperror = True
if 'raise_for_httperror' in kwargs:
do_raise_for_httperror = kwargs['raise_for_httperror']
del kwargs['raise_for_httperror']
return do_raise_for_httperror
@staticmethod
def patch_response(response, do_raise_for_httperror):
if isinstance(response, httpx.Response):
# requests compatibility (response is not streamed)
# see also https://www.python-httpx.org/compatibility/#checking-for-4xx5xx-responses
response.ok = not response.is_error
# raise an exception
if do_raise_for_httperror:
raise_for_httperror(response)
return response
def is_valid_response(self, response):
# pylint: disable=too-many-boolean-expressions
if (
@ -239,6 +261,7 @@ class Network:
async def call_client(self, stream, method, url, **kwargs):
retries = self.retries
was_disconnected = False
do_raise_for_httperror = Network.extract_do_raise_for_httperror(kwargs)
kwargs_clients = Network.extract_kwargs_clients(kwargs)
while retries >= 0: # pragma: no cover
client = await self.get_client(**kwargs_clients)
@ -248,7 +271,7 @@ class Network:
else:
response = await client.request(method, url, **kwargs)
if self.is_valid_response(response) or retries <= 0:
return response
return Network.patch_response(response, do_raise_for_httperror)
except httpx.RemoteProtocolError as e:
if not was_disconnected:
# the server has closed the connection:

88
searx/plugins/tor_check.py

@ -0,0 +1,88 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
"""A plugin to check if the ip address of the request is a TOR exit node if the
user searches for ``tor-check``. It fetches the tor exit node list from
https://check.torproject.org/exit-addresses and parses all the IPs into a list,
then checks if the user's IP address is in it.
Enable in ``settings.yml``:
.. code:: yaml
enabled_plugins:
..
- 'Tor check plugin'
"""
import re
from flask_babel import gettext
from httpx import HTTPError
from searx.network import get
default_on = False
name = gettext("Tor check plugin")
'''Translated name of the plugin'''
description = gettext(
"This plugin checks if the address of the request is a TOR exit node, and"
" informs the user if it is, like check.torproject.org but from searxng."
)
'''Translated description of the plugin.'''
preference_section = 'query'
'''The preference section where the plugin is shown.'''
query_keywords = ['tor-check']
'''Query keywords shown in the preferences.'''
query_examples = ''
'''Query examples shown in the preferences.'''
# Regex for exit node addresses in the list.
reg = re.compile(r"(?<=ExitAddress )\S+")
def post_search(request, search):
if search.search_query.pageno > 1:
return True
if search.search_query.query.lower() == "tor-check":
# Request the list of tor exit nodes.
try:
resp = get("https://check.torproject.org/exit-addresses")
node_list = re.findall(reg, resp.text)
except HTTPError:
# No answer, return error
search.result_container.answers["tor"] = {
"answer": gettext(
"The TOR exit node list (https://check.torproject.org/exit-addresses) is unreachable."
)
}
return True
x_forwarded_for = request.headers.getlist("X-Forwarded-For")
if x_forwarded_for:
ip_address = x_forwarded_for[0]
else:
ip_address = request.remote_addr
if ip_address in node_list:
search.result_container.answers["tor"] = {
"answer": gettext(
"You are using TOR. Your IP address seems to be: {ip_address}.".format(ip_address=ip_address)
)
}
else:
search.result_container.answers["tor"] = {
"answer": gettext(
"You are not using TOR. Your IP address seems to be: {ip_address}.".format(ip_address=ip_address)
)
}
return True

6
searx/settings.yml

@ -2571,6 +2571,12 @@ engines:
timeout: 3.0
disabled: true
- name: emojipedia
engine: emojipedia
timeout: 4.0
shortcut: em
disabled: true
- name: tineye
engine: tineye
shortcut: tin

2
searx/templates/simple/new_issue.html

@ -63,7 +63,7 @@ or manually by executing the searx/webapp.py file? -->
<input type="checkbox" id="step1">
<label for="step1">{{ _('Start submiting a new issue on GitHub') }}</label>
<div class="step1 step_content">
<p><a href="https://github.com/searxng/searxng/issues?q=is%3Aissue+Bug:%20{{ engine_name }}" target="_blank" rel="noreferrer noreferrer">{{ _('Please check for existing bugs about this engine on GitHub') }}</a></p>
<p><a href="{{ get_setting('brand.issue_url') }}?q=is%3Aissue+Bug:%20{{ engine_name }}" target="_blank" rel="noreferrer noreferrer">{{ _('Please check for existing bugs about this engine on GitHub') }}</a></p>
</div>
<input class="step1 step1_delay" type="checkbox" id="step2">
<label class="step1 step1_delay" for="step2" >{{ _('I confirm there is no existing bug about the issue I encounter') }}</label>

4
searx/templates/simple/preferences.html

@ -270,7 +270,7 @@
<p class="value">
<select name='image_proxy' aria-labelledby="pref_image_proxy">
<option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
<option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
<option value="0" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
</select>
</p>
<div class="description">{{ _('Proxying image results through SearXNG') }}</div>
@ -282,7 +282,7 @@
<p class="value">
<select name='query_in_title' aria-labelledby="pref_query_in_title">
<option value="1" {% if query_in_title %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
<option value="" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
<option value="0" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
</select>
</p>
<div class="description">{{ _("When enabled, the result page's title contains your query. Your browser can record this title") }}</div>

BIN
searx/translations/ar/LC_MESSAGES/messages.mo

Binary file not shown.

68
searx/translations/ar/LC_MESSAGES/messages.po

@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-02 08:59+0000\n"
"PO-Revision-Date: 2022-07-08 07:17+0000\n"
"POT-Creation-Date: 2022-07-08 18:28+0000\n"
"PO-Revision-Date: 2022-07-13 15:40+0000\n"
"Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n"
"Language-Team: Arabic <https://weblate.bubu1.eu/projects/searxng/searxng/ar/>"
"\n"
@ -206,27 +206,27 @@ msgstr "المصدر"
msgid "Error loading the next page"
msgstr "حدث خلل أثناء تحميل الصفحة التالية"
#: searx/webapp.py:510 searx/webapp.py:954
#: searx/webapp.py:516 searx/webapp.py:960
msgid "Invalid settings, please edit your preferences"
msgstr "إنّ الإعدادات خاطئة، يرجى تعديل خياراتك"
#: searx/webapp.py:526
#: searx/webapp.py:532
msgid "Invalid settings"
msgstr "إعدادات غير صالحة"
#: searx/webapp.py:603 searx/webapp.py:679
#: searx/webapp.py:609 searx/webapp.py:685
msgid "search error"
msgstr "خطأ في البحث"
#: searx/webapp.py:725
#: searx/webapp.py:731
msgid "{minutes} minute(s) ago"
msgstr "قبل دقائق"
#: searx/webapp.py:727
#: searx/webapp.py:733
msgid "{hours} hour(s), {minutes} minute(s) ago"
msgstr "قبل {hours} ساعات، {minutes} دقائق"
#: searx/webapp.py:853
#: searx/webapp.py:859
msgid "Suspended"
msgstr "معلق"
@ -246,7 +246,7 @@ msgstr "الدالات الإحصائية"
msgid "Compute {functions} of the arguments"
msgstr ""
#: searx/engines/openstreetmap.py:156
#: searx/engines/openstreetmap.py:160
msgid "Get directions"
msgstr "احصل على الاتجاهات"
@ -276,11 +276,11 @@ msgstr ""
#: searx/plugins/hostname_replace.py:9
msgid "Hostname replace"
msgstr ""
msgstr "استبدال اسم المضيف"
#: searx/plugins/hostname_replace.py:10
msgid "Rewrite result hostnames or remove results based on the hostname"
msgstr ""
msgstr "أعد كتابة أسماء مضيفي النتائج أو أزل النتائج بناءً على اسم المضيف"
#: searx/plugins/oa_doi_rewrite.py:9
msgid "Open Access DOI rewrite"
@ -347,45 +347,45 @@ msgstr "صفحة البحث"
msgid "About"
msgstr ""
#: searx/templates/simple/base.html:49
#: searx/templates/simple/base.html:50
msgid "Donate"
msgstr ""
#: searx/templates/simple/base.html:52
#: searx/templates/simple/base.html:54
#: searx/templates/simple/preferences.html:99
msgid "Preferences"
msgstr "التفضيلات"
#: searx/templates/simple/base.html:62
#: searx/templates/simple/base.html:64
msgid "Powered by"
msgstr "مدعوم بواسطة"
#: searx/templates/simple/base.html:62
#: searx/templates/simple/base.html:64
msgid "a privacy-respecting, hackable metasearch engine"
msgstr "محرك بحث يحمي الخصوصية و قابل للتهكير"
#: searx/templates/simple/base.html:63
#: searx/templates/simple/base.html:65
msgid "Source code"
msgstr "الشفرة المصدرية"
#: searx/templates/simple/base.html:64
#: searx/templates/simple/base.html:66
msgid "Issue tracker"
msgstr ""
#: searx/templates/simple/base.html:65 searx/templates/simple/stats.html:18
#: searx/templates/simple/base.html:67 searx/templates/simple/stats.html:18
msgid "Engine stats"
msgstr "إحصائيات المحرك"
#: searx/templates/simple/base.html:66
#: searx/templates/simple/base.html:69
#: searx/templates/simple/messages/no_results.html:15
msgid "Public instances"
msgstr "مثيلات الخوادم العمومية"
#: searx/templates/simple/base.html:68
#: searx/templates/simple/base.html:72
msgid "Privacy policy"
msgstr ""
#: searx/templates/simple/base.html:71
#: searx/templates/simple/base.html:75
msgid "Contact instance maintainer"
msgstr "الإتصال بالمشرف على مثيل الخادم"
@ -410,7 +410,23 @@ msgstr "النسخة المخبأة"
msgid "proxied"
msgstr "النفاذ عبر البروكسي"
#: searx/templates/simple/new_issue.html:63
#: searx/templates/simple/new_issue.html:64
msgid "Start submiting a new issue on GitHub"
msgstr ""
#: searx/templates/simple/new_issue.html:66
msgid "Please check for existing bugs about this engine on GitHub"
msgstr ""
#: searx/templates/simple/new_issue.html:69
msgid "I confirm there is no existing bug about the issue I encounter"
msgstr ""
#: searx/templates/simple/new_issue.html:71
msgid "If this is a public instance, please specify the URL in the bug report"
msgstr ""
#: searx/templates/simple/new_issue.html:72
msgid "Submit a new issue on Github including the above information"
msgstr ""
@ -811,7 +827,7 @@ msgstr "حاول البحث عن :"
#: searx/templates/simple/results.html:152
msgid "Back to top"
msgstr ""
msgstr "العودة للأعلى"
#: searx/templates/simple/results.html:170
msgid "Previous page"
@ -833,7 +849,7 @@ msgstr "البحث عن ..."
#: searx/templates/simple/search.html:10
#: searx/templates/simple/simple_search.html:6
msgid "clear"
msgstr ""
msgstr "مسح"
#: searx/templates/simple/search.html:11
#: searx/templates/simple/simple_search.html:7
@ -882,7 +898,7 @@ msgstr "استثناء"
#: searx/templates/simple/stats.html:110
msgid "Message"
msgstr ""
msgstr "الرسالة"
#: searx/templates/simple/stats.html:112
msgid "Percentage"
@ -910,7 +926,7 @@ msgstr ""
#: searx/templates/simple/stats.html:134
msgid "Failed test"
msgstr ""
msgstr "اختبار فاشل"
#: searx/templates/simple/stats.html:135
msgid "Comment(s)"

BIN
searx/translations/bg/LC_MESSAGES/messages.mo