diff --git a/apps/readest-app/public/locales/ar/translation.json b/apps/readest-app/public/locales/ar/translation.json index 4a97b220..6cc2795d 100644 --- a/apps/readest-app/public/locales/ar/translation.json +++ b/apps/readest-app/public/locales/ar/translation.json @@ -803,5 +803,7 @@ "Successfully imported {{count}} book(s)_two": "تم استيراد كتابين", "Successfully imported {{count}} book(s)_few": "تم استيراد {{count}} كتب", "Successfully imported {{count}} book(s)_many": "تم استيراد {{count}} كتابًا", - "Successfully imported {{count}} book(s)_other": "تم استيراد {{count}} كتاب" + "Successfully imported {{count}} book(s)_other": "تم استيراد {{count}} كتاب", + "Count": "العدد", + "Start Page": "الصفحة الأولى" } diff --git a/apps/readest-app/public/locales/bn/translation.json b/apps/readest-app/public/locales/bn/translation.json index d2ae50e2..c3278c48 100644 --- a/apps/readest-app/public/locales/bn/translation.json +++ b/apps/readest-app/public/locales/bn/translation.json @@ -763,5 +763,7 @@ "Rename Group": "গ্রুপের নাম পরিবর্তন করুন", "From Directory": "ডিরেক্টরি থেকে", "Successfully imported {{count}} book(s)_one": "সফলভাবে ১টি বই আমদানি করা হয়েছে", - "Successfully imported {{count}} book(s)_other": "সফলভাবে {{count}}টি বই আমদানি করা হয়েছে" + "Successfully imported {{count}} book(s)_other": "সফলভাবে {{count}}টি বই আমদানি করা হয়েছে", + "Count": "গণনা", + "Start Page": "শুরু পৃষ্ঠা" } diff --git a/apps/readest-app/public/locales/bo/translation.json b/apps/readest-app/public/locales/bo/translation.json index b19be887..e32c36ed 100644 --- a/apps/readest-app/public/locales/bo/translation.json +++ b/apps/readest-app/public/locales/bo/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "སྤྲིན་གནས་སྣོད་གསོག་ལུས་སྐོར།", "Rename Group": "ཚོགས་མིང་བསྒྱུར་བ།", "From Directory": "སྐོར་འདེམས་པ་ནས།", - "Successfully imported {{count}} book(s)_other": "སྤྲིན་ནས་ཕབ་སྟེ་འབེབས་ {{count}} དེབ་འདེམས་སོང་" + "Successfully imported {{count}} book(s)_other": "སྤྲིན་ནས་ཕབ་སྟེ་འབེབས་ {{count}} དེབ་འདེམས་སོང་", + "Count": "ཨང་", + "Start Page": "ཤོག་ངོས་དང་པོ" } diff --git a/apps/readest-app/public/locales/de/translation.json b/apps/readest-app/public/locales/de/translation.json index 99d9be25..2ecdd612 100644 --- a/apps/readest-app/public/locales/de/translation.json +++ b/apps/readest-app/public/locales/de/translation.json @@ -763,5 +763,7 @@ "Rename Group": "Gruppe umbenennen", "From Directory": "Aus Verzeichnis", "Successfully imported {{count}} book(s)_one": "Erfolgreich 1 Buch importiert", - "Successfully imported {{count}} book(s)_other": "Erfolgreich {{count}} Bücher importiert" + "Successfully imported {{count}} book(s)_other": "Erfolgreich {{count}} Bücher importiert", + "Count": "Anzahl", + "Start Page": "Startseite" } diff --git a/apps/readest-app/public/locales/el/translation.json b/apps/readest-app/public/locales/el/translation.json index 36338055..39af627a 100644 --- a/apps/readest-app/public/locales/el/translation.json +++ b/apps/readest-app/public/locales/el/translation.json @@ -763,5 +763,7 @@ "Rename Group": "Μετονομασία ομάδας", "From Directory": "Από κατάλογο", "Successfully imported {{count}} book(s)_one": "Επιτυχής εισαγωγή 1 βιβλίου", - "Successfully imported {{count}} book(s)_other": "Επιτυχής εισαγωγή {{count}} βιβλίων" + "Successfully imported {{count}} book(s)_other": "Επιτυχής εισαγωγή {{count}} βιβλίων", + "Count": "Πλήθος", + "Start Page": "Αρχική Σελίδα" } diff --git a/apps/readest-app/public/locales/es/translation.json b/apps/readest-app/public/locales/es/translation.json index 6b963fa8..91ed2eed 100644 --- a/apps/readest-app/public/locales/es/translation.json +++ b/apps/readest-app/public/locales/es/translation.json @@ -773,5 +773,7 @@ "From Directory": "Desde el directorio", "Successfully imported {{count}} book(s)_one": "Se importó correctamente 1 libro", "Successfully imported {{count}} book(s)_many": "Se importaron correctamente {{count}} libros", - "Successfully imported {{count}} book(s)_other": "Se importaron correctamente {{count}} libros" + "Successfully imported {{count}} book(s)_other": "Se importaron correctamente {{count}} libros", + "Count": "Cuenta", + "Start Page": "Página de inicio" } diff --git a/apps/readest-app/public/locales/fa/translation.json b/apps/readest-app/public/locales/fa/translation.json index 2166aa43..bf3c56e8 100644 --- a/apps/readest-app/public/locales/fa/translation.json +++ b/apps/readest-app/public/locales/fa/translation.json @@ -763,5 +763,7 @@ "Rename Group": "تغییر نام گروه", "From Directory": "از مسیر", "Successfully imported {{count}} book(s)_one": "با موفقیت 1 کتاب وارد شد", - "Successfully imported {{count}} book(s)_other": "با موفقیت {{count}} کتاب وارد شد" + "Successfully imported {{count}} book(s)_other": "با موفقیت {{count}} کتاب وارد شد", + "Count": "تعداد", + "Start Page": "صفحه شروع" } diff --git a/apps/readest-app/public/locales/fr/translation.json b/apps/readest-app/public/locales/fr/translation.json index 1413ab83..adc5bc4c 100644 --- a/apps/readest-app/public/locales/fr/translation.json +++ b/apps/readest-app/public/locales/fr/translation.json @@ -773,5 +773,7 @@ "From Directory": "Depuis le répertoire", "Successfully imported {{count}} book(s)_one": "Importation réussie de 1 livre", "Successfully imported {{count}} book(s)_many": "Importation réussie de {{count}} livres", - "Successfully imported {{count}} book(s)_other": "Importation réussie de {{count}} livres" + "Successfully imported {{count}} book(s)_other": "Importation réussie de {{count}} livres", + "Count": "Nombre", + "Start Page": "Page de départ" } diff --git a/apps/readest-app/public/locales/hi/translation.json b/apps/readest-app/public/locales/hi/translation.json index 5ef44c4c..3bad4d21 100644 --- a/apps/readest-app/public/locales/hi/translation.json +++ b/apps/readest-app/public/locales/hi/translation.json @@ -763,5 +763,7 @@ "Rename Group": "समूह का नाम बदलें", "From Directory": "निर्देशिका से", "Successfully imported {{count}} book(s)_one": "सफलतापूर्वक 1 पुस्तक आयात की गई", - "Successfully imported {{count}} book(s)_other": "सफलतापूर्वक {{count}} पुस्तकों का आयात किया गया" + "Successfully imported {{count}} book(s)_other": "सफलतापूर्वक {{count}} पुस्तकों का आयात किया गया", + "Count": "गणना", + "Start Page": "प्रारंभ पृष्ठ" } diff --git a/apps/readest-app/public/locales/id/translation.json b/apps/readest-app/public/locales/id/translation.json index f2830cfc..74509878 100644 --- a/apps/readest-app/public/locales/id/translation.json +++ b/apps/readest-app/public/locales/id/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "Penggunaan Penyimpanan Cloud", "Rename Group": "Ganti Nama Grup", "From Directory": "Dari Direktori", - "Successfully imported {{count}} book(s)_other": "Berhasil mengimpor {{count}} buku" + "Successfully imported {{count}} book(s)_other": "Berhasil mengimpor {{count}} buku", + "Count": "Jumlah", + "Start Page": "Halaman Awal" } diff --git a/apps/readest-app/public/locales/it/translation.json b/apps/readest-app/public/locales/it/translation.json index d3c1c4c4..9e788e1a 100644 --- a/apps/readest-app/public/locales/it/translation.json +++ b/apps/readest-app/public/locales/it/translation.json @@ -773,5 +773,7 @@ "From Directory": "Da directory", "Successfully imported {{count}} book(s)_one": "Importato con successo 1 libro", "Successfully imported {{count}} book(s)_many": "Importati con successo {{count}} libri", - "Successfully imported {{count}} book(s)_other": "Importati con successo {{count}} libri" + "Successfully imported {{count}} book(s)_other": "Importati con successo {{count}} libri", + "Count": "Conteggio", + "Start Page": "Pagina iniziale" } diff --git a/apps/readest-app/public/locales/ja/translation.json b/apps/readest-app/public/locales/ja/translation.json index 3f63ee08..07c9a411 100644 --- a/apps/readest-app/public/locales/ja/translation.json +++ b/apps/readest-app/public/locales/ja/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "クラウドストレージ使用量", "Rename Group": "グループ名を変更", "From Directory": "ディレクトリから", - "Successfully imported {{count}} book(s)_other": "成功裏に{{count}}冊の本をインポートしました" + "Successfully imported {{count}} book(s)_other": "成功裏に{{count}}冊の本をインポートしました", + "Count": "件数", + "Start Page": "開始ページ" } diff --git a/apps/readest-app/public/locales/ko/translation.json b/apps/readest-app/public/locales/ko/translation.json index 54e06d9b..94845528 100644 --- a/apps/readest-app/public/locales/ko/translation.json +++ b/apps/readest-app/public/locales/ko/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "클라우드 저장소 사용량", "Rename Group": "그룹 이름 바꾸기", "From Directory": "디렉토리에서", - "Successfully imported {{count}} book(s)_other": "성공적으로 {{count}} 권의 책이 가져와졌습니다" + "Successfully imported {{count}} book(s)_other": "성공적으로 {{count}} 권의 책이 가져와졌습니다", + "Count": "개수", + "Start Page": "시작 페이지" } diff --git a/apps/readest-app/public/locales/ms/translation.json b/apps/readest-app/public/locales/ms/translation.json index 151c5497..3aa30726 100644 --- a/apps/readest-app/public/locales/ms/translation.json +++ b/apps/readest-app/public/locales/ms/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "Penggunaan Storan Awan", "Rename Group": "Namakan Semula Kumpulan", "From Directory": "Dari Direktori", - "Successfully imported {{count}} book(s)_other": "Berjaya mengimport {{count}} buku" + "Successfully imported {{count}} book(s)_other": "Berjaya mengimport {{count}} buku", + "Count": "Jumlah", + "Start Page": "Halaman Awal" } diff --git a/apps/readest-app/public/locales/nl/translation.json b/apps/readest-app/public/locales/nl/translation.json index a0692d76..aac9419e 100644 --- a/apps/readest-app/public/locales/nl/translation.json +++ b/apps/readest-app/public/locales/nl/translation.json @@ -763,5 +763,7 @@ "Rename Group": "Groep hernoemen", "From Directory": "Vanuit map", "Successfully imported {{count}} book(s)_one": "Succesvol 1 boek geïmporteerd", - "Successfully imported {{count}} book(s)_other": "Succesvol {{count}} boeken geïmporteerd" + "Successfully imported {{count}} book(s)_other": "Succesvol {{count}} boeken geïmporteerd", + "Count": "Aantal", + "Start Page": "Startpagina" } diff --git a/apps/readest-app/public/locales/pl/translation.json b/apps/readest-app/public/locales/pl/translation.json index 0381b51b..b27c71dc 100644 --- a/apps/readest-app/public/locales/pl/translation.json +++ b/apps/readest-app/public/locales/pl/translation.json @@ -783,5 +783,7 @@ "Successfully imported {{count}} book(s)_one": "Pomyślnie zaimportowano 1 książkę", "Successfully imported {{count}} book(s)_few": "Pomyślnie zaimportowano {{count}} książki", "Successfully imported {{count}} book(s)_many": "Pomyślnie zaimportowano {{count}} książek", - "Successfully imported {{count}} book(s)_other": "Pomyślnie zaimportowano {{count}} książek" + "Successfully imported {{count}} book(s)_other": "Pomyślnie zaimportowano {{count}} książek", + "Count": "Liczba", + "Start Page": "Strona startowa" } diff --git a/apps/readest-app/public/locales/pt/translation.json b/apps/readest-app/public/locales/pt/translation.json index f300273b..700c7707 100644 --- a/apps/readest-app/public/locales/pt/translation.json +++ b/apps/readest-app/public/locales/pt/translation.json @@ -773,5 +773,7 @@ "From Directory": "Do Diretório", "Successfully imported {{count}} book(s)_one": "Importado com sucesso 1 livro", "Successfully imported {{count}} book(s)_many": "Importados com sucesso {{count}} livros", - "Successfully imported {{count}} book(s)_other": "Importados com sucesso {{count}} livros" + "Successfully imported {{count}} book(s)_other": "Importados com sucesso {{count}} livros", + "Count": "Contagem", + "Start Page": "Página Inicial" } diff --git a/apps/readest-app/public/locales/ru/translation.json b/apps/readest-app/public/locales/ru/translation.json index 352c9ac0..feb59863 100644 --- a/apps/readest-app/public/locales/ru/translation.json +++ b/apps/readest-app/public/locales/ru/translation.json @@ -783,5 +783,7 @@ "Successfully imported {{count}} book(s)_one": "Успешно импортирован 1 книга", "Successfully imported {{count}} book(s)_few": "Успешно импортировано {{count}} книги", "Successfully imported {{count}} book(s)_many": "Успешно импортировано {{count}} книг", - "Successfully imported {{count}} book(s)_other": "Успешно импортировано {{count}} книг" + "Successfully imported {{count}} book(s)_other": "Успешно импортировано {{count}} книг", + "Count": "Количество", + "Start Page": "Начальная страница" } diff --git a/apps/readest-app/public/locales/si/translation.json b/apps/readest-app/public/locales/si/translation.json index 75d81d9c..98fe57b9 100644 --- a/apps/readest-app/public/locales/si/translation.json +++ b/apps/readest-app/public/locales/si/translation.json @@ -763,5 +763,7 @@ "Rename Group": "කණ්ඩායම නැවත නම් කරන්න", "From Directory": "ෆෝල්ඩරයෙන්", "Successfully imported {{count}} book(s)_one": "සාර්ථකව ආයාත කළ 1 පොත", - "Successfully imported {{count}} book(s)_other": "සාර්ථකව ආයාත කළ {{count}} පොත්" + "Successfully imported {{count}} book(s)_other": "සාර්ථකව ආයාත කළ {{count}} පොත්", + "Count": "ගණන", + "Start Page": "ආරම්භක පිටුව" } diff --git a/apps/readest-app/public/locales/sv/translation.json b/apps/readest-app/public/locales/sv/translation.json index 90987c12..85cd235e 100644 --- a/apps/readest-app/public/locales/sv/translation.json +++ b/apps/readest-app/public/locales/sv/translation.json @@ -763,5 +763,7 @@ "Rename Group": "Byt namn på grupp", "From Directory": "Från katalog", "Successfully imported {{count}} book(s)_one": "Importerat 1 bok", - "Successfully imported {{count}} book(s)_other": "Importerat {{count}} böcker" + "Successfully imported {{count}} book(s)_other": "Importerat {{count}} böcker", + "Count": "Antal", + "Start Page": "Start sida" } diff --git a/apps/readest-app/public/locales/ta/translation.json b/apps/readest-app/public/locales/ta/translation.json index 213f7dec..9eccef8f 100644 --- a/apps/readest-app/public/locales/ta/translation.json +++ b/apps/readest-app/public/locales/ta/translation.json @@ -763,5 +763,7 @@ "Rename Group": "குழுவை மறுபெயரிடவும்", "From Directory": "கோப்புறையிலிருந்து", "Successfully imported {{count}} book(s)_one": "வெற்றிகரமாக 1 புத்தகம் இறக்குமதி செய்யப்பட்டது", - "Successfully imported {{count}} book(s)_other": "வெற்றிகரமாக {{count}} புத்தகங்கள் இறக்குமதி செய்யப்பட்டது" + "Successfully imported {{count}} book(s)_other": "வெற்றிகரமாக {{count}} புத்தகங்கள் இறக்குமதி செய்யப்பட்டது", + "Count": "எண்ணிக்கை", + "Start Page": "தொடக்கப் பக்கம்" } diff --git a/apps/readest-app/public/locales/th/translation.json b/apps/readest-app/public/locales/th/translation.json index 15bb8454..997b78b3 100644 --- a/apps/readest-app/public/locales/th/translation.json +++ b/apps/readest-app/public/locales/th/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "การใช้งานพื้นที่เก็บข้อมูลคลาวด์", "Rename Group": "เปลี่ยนชื่อกลุ่ม", "From Directory": "จากไดเรกทอรี", - "Successfully imported {{count}} book(s)_other": "นำเข้า {{count}} หนังสือเรียบร้อยแล้ว" + "Successfully imported {{count}} book(s)_other": "นำเข้า {{count}} หนังสือเรียบร้อยแล้ว", + "Count": "นับ", + "Start Page": "หน้าเริ่มต้น" } diff --git a/apps/readest-app/public/locales/tr/translation.json b/apps/readest-app/public/locales/tr/translation.json index 746236cf..69361b98 100644 --- a/apps/readest-app/public/locales/tr/translation.json +++ b/apps/readest-app/public/locales/tr/translation.json @@ -763,5 +763,7 @@ "Rename Group": "Grubu Yeniden Adlandır", "From Directory": "Dizinden", "Successfully imported {{count}} book(s)_one": "Başarıyla 1 kitap içe aktarıldı", - "Successfully imported {{count}} book(s)_other": "Başarıyla {{count}} kitap içe aktarıldı" + "Successfully imported {{count}} book(s)_other": "Başarıyla {{count}} kitap içe aktarıldı", + "Count": "Sayım", + "Start Page": "Başlangıç Sayfası" } diff --git a/apps/readest-app/public/locales/uk/translation.json b/apps/readest-app/public/locales/uk/translation.json index 5f679766..51cc99d3 100644 --- a/apps/readest-app/public/locales/uk/translation.json +++ b/apps/readest-app/public/locales/uk/translation.json @@ -783,5 +783,7 @@ "Successfully imported {{count}} book(s)_one": "Успішно імпортовано 1 книгу", "Successfully imported {{count}} book(s)_few": "Успішно імпортовано {{count}} книги", "Successfully imported {{count}} book(s)_many": "Успішно імпортовано {{count}} книг", - "Successfully imported {{count}} book(s)_other": "Успішно імпортовано {{count}} книг" + "Successfully imported {{count}} book(s)_other": "Успішно імпортовано {{count}} книг", + "Count": "Кількість", + "Start Page": "Початкова сторінка" } diff --git a/apps/readest-app/public/locales/vi/translation.json b/apps/readest-app/public/locales/vi/translation.json index 8a2b63e8..2e609faa 100644 --- a/apps/readest-app/public/locales/vi/translation.json +++ b/apps/readest-app/public/locales/vi/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "Sử dụng lưu trữ đám mây", "Rename Group": "Đổi tên nhóm", "From Directory": "Từ thư mục", - "Successfully imported {{count}} book(s)_other": "Đã nhập thành công {{count}} sách" + "Successfully imported {{count}} book(s)_other": "Đã nhập thành công {{count}} sách", + "Count": "Số lượng", + "Start Page": "Trang bắt đầu" } diff --git a/apps/readest-app/public/locales/zh-CN/translation.json b/apps/readest-app/public/locales/zh-CN/translation.json index 2f93cbd6..0b2d3726 100644 --- a/apps/readest-app/public/locales/zh-CN/translation.json +++ b/apps/readest-app/public/locales/zh-CN/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "云存储使用情况", "Rename Group": "重命名分组", "From Directory": "从文件夹导入", - "Successfully imported {{count}} book(s)_other": "成功导入 {{count}} 本书" + "Successfully imported {{count}} book(s)_other": "成功导入 {{count}} 本书", + "Count": "数量", + "Start Page": "起始页" } diff --git a/apps/readest-app/public/locales/zh-TW/translation.json b/apps/readest-app/public/locales/zh-TW/translation.json index eeb02fb8..99a5779e 100644 --- a/apps/readest-app/public/locales/zh-TW/translation.json +++ b/apps/readest-app/public/locales/zh-TW/translation.json @@ -753,5 +753,7 @@ "Cloud Storage Usage": "雲端儲存使用情況", "Rename Group": "重新命名", "From Directory": "從目錄導入", - "Successfully imported {{count}} book(s)_other": "成功導入 {{count}} 本書" + "Successfully imported {{count}} book(s)_other": "成功導入 {{count}} 本書", + "Count": "數量", + "Start Page": "起始頁" } diff --git a/apps/readest-app/src/app/api/opds/proxy/route.ts b/apps/readest-app/src/app/api/opds/proxy/route.ts index f6e2035b..49fd8a85 100644 --- a/apps/readest-app/src/app/api/opds/proxy/route.ts +++ b/apps/readest-app/src/app/api/opds/proxy/route.ts @@ -1,3 +1,4 @@ +import { READEST_OPDS_USER_AGENT } from '@/services/constants'; import { NextRequest, NextResponse } from 'next/server'; async function handleRequest(request: NextRequest, method: 'GET' | 'HEAD') { @@ -35,7 +36,7 @@ async function handleRequest(request: NextRequest, method: 'GET' | 'HEAD') { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 20000); const headers: HeadersInit = { - 'User-Agent': 'Readest/1.0 (OPDS Browser)', + 'User-Agent': READEST_OPDS_USER_AGENT, Accept: 'application/atom+xml, application/xml, text/xml, application/json, */*', }; diff --git a/apps/readest-app/src/app/opds/components/CatelogManager.tsx b/apps/readest-app/src/app/opds/components/CatelogManager.tsx index e655f7a1..2ac87c63 100644 --- a/apps/readest-app/src/app/opds/components/CatelogManager.tsx +++ b/apps/readest-app/src/app/opds/components/CatelogManager.tsx @@ -27,6 +27,7 @@ const POPULAR_CATALOGS: OPDSCatalog[] = [ url: 'https://standardebooks.org/feeds/opds', description: 'Free and liberated ebooks, carefully produced for the true book lover', icon: '📚', + disabled: isWebAppPlatform(), }, { id: 'manybooks', diff --git a/apps/readest-app/src/app/opds/components/SearchView.tsx b/apps/readest-app/src/app/opds/components/SearchView.tsx index 32fe495e..974b54b7 100644 --- a/apps/readest-app/src/app/opds/components/SearchView.tsx +++ b/apps/readest-app/src/app/opds/components/SearchView.tsx @@ -17,7 +17,13 @@ export function SearchView({ search, baseURL, onNavigate, resolveURL }: SearchVi const [formData, setFormData] = useState>(() => { const initial: Record = {}; search.params?.forEach((param) => { - initial[param.name] = param.value || ''; + if (param.name === 'count') { + initial[param.name] = '20'; + } else if (param.name === 'startPage') { + initial[param.name] = '1'; + } else { + initial[param.name] = param.value || ''; + } }); return initial; }); @@ -56,6 +62,8 @@ export function SearchView({ search, baseURL, onNavigate, resolveURL }: SearchVi publisher: _('Publisher'), language: _('Language'), subject: _('Subject'), + count: _('Count'), + startPage: _('Start Page'), }; return labels[name] || name; }; diff --git a/apps/readest-app/src/app/opds/page.tsx b/apps/readest-app/src/app/opds/page.tsx index dab820a5..6d2682a1 100644 --- a/apps/readest-app/src/app/opds/page.tsx +++ b/apps/readest-app/src/app/opds/page.tsx @@ -21,6 +21,7 @@ import { getFileExtFromMimeType } from '@/libs/document'; import { OPDSFeed, OPDSPublication, OPDSSearch } from '@/types/opds'; import { isSearchLink, MIME, parseMediaType, resolveURL } from './utils/opdsUtils'; import { getProxiedURL, fetchWithAuth, probeAuth, needsProxy } from './utils/opdsReq'; +import { READEST_OPDS_USER_AGENT } from '@/services/constants'; import { FeedView } from './components/FeedView'; import { PublicationView } from './components/PublicationView'; import { SearchView } from './components/SearchView'; @@ -362,7 +363,7 @@ export default function BrowserPage() { const useProxy = needsProxy(url); let downloadUrl = useProxy ? getProxiedURL(url, '', true) : url; const headers: Record = { - 'User-Agent': 'Readest/1.0 (OPDS Browser)', + 'User-Agent': READEST_OPDS_USER_AGENT, }; if (username || password) { const authHeader = await probeAuth(url, username, password, useProxy); diff --git a/apps/readest-app/src/app/opds/utils/opdsReq.ts b/apps/readest-app/src/app/opds/utils/opdsReq.ts index 396a0294..2331053f 100644 --- a/apps/readest-app/src/app/opds/utils/opdsReq.ts +++ b/apps/readest-app/src/app/opds/utils/opdsReq.ts @@ -1,6 +1,7 @@ import { md5 } from 'js-md5'; import { isTauriAppPlatform, isWebAppPlatform } from '@/services/environment'; import { fetch as tauriFetch } from '@tauri-apps/plugin-http'; +import { READEST_OPDS_USER_AGENT } from '@/services/constants'; /** * Extract username and password from URL credentials @@ -184,6 +185,7 @@ export const probeAuth = async ( const fetchURL = useProxy ? getProxiedURL(cleanUrl) : cleanUrl; const headers: Record = { + 'User-Agent': READEST_OPDS_USER_AGENT, Accept: 'application/atom+xml, application/xml, text/xml', }; @@ -241,6 +243,7 @@ export const fetchWithAuth = async ( const fetchURL = useProxy ? getProxiedURL(cleanUrl) : cleanUrl; const headers: Record = { + 'User-Agent': READEST_OPDS_USER_AGENT, Accept: 'application/atom+xml, application/xml, text/xml', ...(options.headers as Record), }; diff --git a/apps/readest-app/src/services/constants.ts b/apps/readest-app/src/services/constants.ts index 6a3493f1..b8e4de00 100644 --- a/apps/readest-app/src/services/constants.ts +++ b/apps/readest-app/src/services/constants.ts @@ -615,6 +615,8 @@ export const READEST_UPDATER_FILE = `${LATEST_DOWNLOAD_BASE_URL}/latest.json`; export const READEST_CHANGELOG_FILE = `${LATEST_DOWNLOAD_BASE_URL}/release-notes.json`; +export const READEST_OPDS_USER_AGENT = 'Readest/1.0 (OPDS Browser)'; + export const SYNC_PROGRESS_INTERVAL_SEC = 3; export const SYNC_NOTES_INTERVAL_SEC = 5; export const SYNC_BOOKS_INTERVAL_SEC = 5; diff --git a/packages/foliate-js b/packages/foliate-js index 861aec11..a325057b 160000 --- a/packages/foliate-js +++ b/packages/foliate-js @@ -1 +1 @@ -Subproject commit 861aec11925218e255c927695713a554dd562e14 +Subproject commit a325057bcedb9d5073353c85949d0f2f8037f237