diff --git a/src/App.tsx b/src/App.tsx index 29e5b3b..263463d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -81,6 +81,8 @@ export default function App({ children }: { children: React.ReactNode }) { const SPONSORBLOCK_REMOVE_CATEGORIES = useSettingsPageStatesStore(state => state.settings.sponsorblock_remove_categories); const SPONSORBLOCK_MARK_CATEGORIES = useSettingsPageStatesStore(state => state.settings.sponsorblock_mark_categories); const USE_ARIA2 = useSettingsPageStatesStore(state => state.settings.use_aria2); + const USE_FORCE_INTERNET_PROTOCOL = useSettingsPageStatesStore(state => state.settings.use_force_internet_protocol); + const FORCE_INTERNET_PROTOCOL = useSettingsPageStatesStore(state => state.settings.force_internet_protocol); const isErrored = useDownloaderPageStatesStore((state) => state.isErrored); const isErrorExpected = useDownloaderPageStatesStore((state) => state.isErrorExpected); @@ -123,6 +125,13 @@ export default function App({ children }: { children: React.ReactNode }) { if (STRICT_DOWNLOADABILITY_CHECK && !formatId) args.push('--check-all-formats'); if (STRICT_DOWNLOADABILITY_CHECK && formatId) args.push('--check-formats'); if (USE_PROXY && PROXY_URL) args.push('--proxy', PROXY_URL); + if (USE_FORCE_INTERNET_PROTOCOL && FORCE_INTERNET_PROTOCOL) { + if (FORCE_INTERNET_PROTOCOL === 'ipv4') { + args.push('--force-ipv4'); + } else if (FORCE_INTERNET_PROTOCOL === 'ipv6') { + args.push('--force-ipv6'); + } + } if (USE_COOKIES) { if (IMPORT_COOKIES_FROM === 'browser' && COOKIES_BROWSER) { args.push('--cookies-from-browser', COOKIES_BROWSER); @@ -293,6 +302,14 @@ export default function App({ children }: { children: React.ReactNode }) { if (USE_RATE_LIMIT && RATE_LIMIT) { args.push('--limit-rate', `${RATE_LIMIT}`); } + + if (USE_FORCE_INTERNET_PROTOCOL && FORCE_INTERNET_PROTOCOL) { + if (FORCE_INTERNET_PROTOCOL === 'ipv4') { + args.push('--force-ipv4'); + } else if (FORCE_INTERNET_PROTOCOL === 'ipv6') { + args.push('--force-ipv6'); + } + } if (USE_COOKIES) { if (IMPORT_COOKIES_FROM === 'browser' && COOKIES_BROWSER) { diff --git a/src/pages/settings.tsx b/src/pages/settings.tsx index 7edf550..9e8a8b8 100644 --- a/src/pages/settings.tsx +++ b/src/pages/settings.tsx @@ -107,6 +107,8 @@ export default function SettingsPage() { const sponsorblockRemoveCategories = useSettingsPageStatesStore(state => state.settings.sponsorblock_remove_categories); const sponsorblockMarkCategories = useSettingsPageStatesStore(state => state.settings.sponsorblock_mark_categories); const useAria2 = useSettingsPageStatesStore(state => state.settings.use_aria2); + const useForceInternetProtocol = useSettingsPageStatesStore(state => state.settings.use_force_internet_protocol); + const forceInternetProtocol = useSettingsPageStatesStore(state => state.settings.force_internet_protocol); const websocketPort = useSettingsPageStatesStore(state => state.settings.websocket_port); const isChangingWebSocketPort = useSettingsPageStatesStore(state => state.isChangingWebSocketPort); @@ -737,6 +739,35 @@ export default function SettingsPage() { +
Force using a specific internet protocol (ipv4/ipv6) for all downloads, useful if you network supports only one (some sites may not work)
+