Skip to content

Commit 9e1813b

Browse files
committed
The ability to select multiple geo-bypass locations has been added.
1 parent 37f7801 commit 9e1813b

File tree

7 files changed

+105
-4
lines changed

7 files changed

+105
-4
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ Please see [QtLicense.md](QtLicense.md) for full LGPL-3.0 compliance information
103103
- **Queue System Optimization**
104104
Concurrency management with pause & resume all functionality and bandwidth limiting support via proxy settings.
105105

106+
- **Geographic Bypass** 🌍
107+
Advanced geo-restriction bypass with **10 country options**:
108+
- **United States** (US) - Default, maximum content access
109+
- **Russia** (RU) - Bypass EU restrictions and access regional content
110+
- **Germany** (DE) - European region access
111+
- **United Kingdom** (GB) - UK-specific content
112+
- **Japan** (JP) - Asian content and region-locked videos
113+
- **France** (FR), **Canada** (CA), **Australia** (AU), **Netherlands** (NL), **Sweden** (SE)
114+
- User-selectable country preference saved in profile settings
115+
- Automatic IP simulation for bypassing geographic content blocks
116+
106117
- **Auto-Updater**
107118
Automatically checks for updates and installs them.
108119

@@ -182,6 +193,7 @@ python main.py
182193
- Use the MP4 or MP3 pages to download videos or extract audio
183194
- Add multiple downloads to the queue and manage them from the Queue page
184195
- Schedule downloads in advance using the Scheduler
196+
- **Geographic Bypass**: Go to Settings → Geo-Bypass Settings to select your preferred country for bypassing regional content restrictions
185197

186198
### Tips & Tricks
187199
- Use drag & drop for quick URL addition

README.ru.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@
102102
- **Оптимизация системы очередей**
103103
Управление параллелизмом с функцией приостановки и возобновления всех загрузок и поддержкой ограничения пропускной способности через настройки прокси.
104104

105+
- **Географический обход** 🌍
106+
Продвинутый обход географических ограничений с **10 вариантами стран**:
107+
- **США** (US) - По умолчанию, максимальный доступ к контенту
108+
- **Россия** (RU) - Обход ограничений ЕС и доступ к региональному контенту
109+
- **Германия** (DE) - Доступ к европейскому региону
110+
- **Великобритания** (GB) - Контент, специфичный для Великобритании
111+
- **Япония** (JP) - Азиатский контент и видео с региональными ограничениями
112+
- **Франция** (FR), **Канада** (CA), **Австралия** (AU), **Нидерланды** (NL), **Швеция** (SE)
113+
- Пользовательский выбор страны сохраняется в настройках профиля
114+
- Автоматическая симуляция IP для обхода географических блокировок контента
115+
105116
- **Автообновление**
106117
Автоматическая проверка обновлений и их установка.
107118

@@ -181,6 +192,7 @@ python main.py
181192
- Используйте страницы MP4 или MP3 для загрузки видео или извлечения аудио
182193
- Добавляйте несколько загрузок в очередь и управляйте ими со страницы Очередь
183194
- Планируйте загрузки заранее с помощью Планировщика
195+
- **Географический обход**: Перейдите в Настройки → Настройки Гео-обхода, чтобы выбрать предпочитаемую страну для обхода региональных ограничений контента
184196

185197
### Советы и рекомендации
186198
- Используйте перетаскивание для быстрого добавления URL

core/downloader.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ def __init__(self, url, resolution, folder, proxy, audio_only=False, playlist=Fa
5353
self.audio_quality = audio_quality
5454

5555
class DownloadQueueWorker(QRunnable):
56-
def __init__(self, task, row, progress_signal, status_signal, log_signal, info_signal=None):
56+
def __init__(self, task, row, progress_signal, status_signal, log_signal, info_signal=None, user_profile=None):
5757
super().__init__()
5858
self.task = task
5959
self.row = row
6060
self.progress_signal = progress_signal
6161
self.status_signal = status_signal
6262
self.log_signal = log_signal
6363
self.info_signal = info_signal
64+
self.user_profile = user_profile
6465
self.cancel = False
6566
self.data_dir = get_data_dir()
6667
if not os.path.exists(self.data_dir):
@@ -85,6 +86,10 @@ def cleanup(self):
8586
gc.collect()
8687

8788
def _get_base_options(self):
89+
geo_country = "US"
90+
if self.user_profile:
91+
geo_country = self.user_profile.get_geo_bypass_country()
92+
8893
return {
8994
"cookiefile": self.cookie_file,
9095
"ignoreerrors": True,
@@ -94,7 +99,7 @@ def _get_base_options(self):
9499
"socket_timeout": 10,
95100
"updatetime": False,
96101
"geo_bypass": True,
97-
"geo_bypass_country": "US",
102+
"geo_bypass_country": geo_country,
98103
"force_ipv4": True
99104
}
100105

core/profile.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def __init__(self, profile_path="user_profile.json"):
2020
"proxy": "",
2121
"audio_format": "mp3",
2222
"audio_quality": "320",
23-
"preserve_quality": True
23+
"preserve_quality": True,
24+
"geo_bypass_country": "US"
2425
}
2526
self.load_profile()
2627

@@ -35,6 +36,8 @@ def load_profile(self):
3536
self.data["audio_quality"] = "320"
3637
if "preserve_quality" not in self.data:
3738
self.data["preserve_quality"] = True
39+
if "geo_bypass_country" not in self.data:
40+
self.data["geo_bypass_country"] = "US"
3841
self.save_profile()
3942
except json.JSONDecodeError as e:
4043
print(f"Warning: Profile file corrupted, creating new one. Error: {e}")
@@ -158,3 +161,24 @@ def get_preserve_quality(self):
158161
def set_preserve_quality(self, preserve):
159162
self.data["preserve_quality"] = preserve
160163
self.save_profile()
164+
165+
def get_geo_bypass_country(self):
166+
return self.data.get("geo_bypass_country", "US")
167+
168+
def set_geo_bypass_country(self, country):
169+
self.data["geo_bypass_country"] = country
170+
self.save_profile()
171+
172+
def get_available_geo_bypass_countries(self):
173+
return {
174+
"US": "United States",
175+
"RU": "Russia",
176+
"DE": "Germany",
177+
"GB": "United Kingdom",
178+
"FR": "France",
179+
"JP": "Japan",
180+
"CA": "Canada",
181+
"AU": "Australia",
182+
"NL": "Netherlands",
183+
"SE": "Sweden"
184+
}

ui/main_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def run_task(self, task, row):
211211
self.update_status(row, "Preparing Download...")
212212
self.tray_manager.show_message("Download", "Preparing to download...")
213213

214-
worker = DownloadQueueWorker(task, row, self.progress_signal, self.status_signal, self.log_signal, self.info_signal)
214+
worker = DownloadQueueWorker(task, row, self.progress_signal, self.status_signal, self.log_signal, self.info_signal, self.user_profile)
215215
self.thread_pool.start(worker)
216216
self.active_workers.append(worker)
217217
def update_progress(self, row, percent):

ui/pages/profile_page.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ def init_ui(self):
7878
self.preferences_layout.addWidget(QLabel("Proxy:"), 5, 0)
7979
self.preferences_layout.addWidget(self.proxy_value, 5, 1)
8080

81+
self.geo_country_value = QLabel()
82+
self.geo_country_value.setStyleSheet("font-weight: bold;")
83+
self.preferences_layout.addWidget(QLabel("Geo-Bypass Country:"), 6, 0)
84+
self.preferences_layout.addWidget(self.geo_country_value, 6, 1)
85+
8186
self.preferences_group.setLayout(self.preferences_layout)
8287
layout.addWidget(self.preferences_group)
8388

@@ -96,6 +101,11 @@ def refresh_preferences(self):
96101
self.download_path_value.setText(self.parent.user_profile.get_download_path())
97102
self.history_value.setText("Yes" if self.parent.user_profile.is_history_enabled() else "No")
98103
self.proxy_value.setText(self.parent.user_profile.get_proxy() or "Not Set")
104+
105+
geo_country = self.parent.user_profile.get_geo_bypass_country()
106+
countries = self.parent.user_profile.get_available_geo_bypass_countries()
107+
country_name = countries.get(geo_country, geo_country)
108+
self.geo_country_value.setText(f"{country_name} ({geo_country})")
99109

100110
def pick_pic(self):
101111
path, _ = QFileDialog.getOpenFileName(self, "Select Profile Picture", "", "Images (*.png *.jpg *.jpeg)")

ui/pages/settings_page.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,38 @@ def init_ui(self):
208208
q_layout.addRow("Preserve Original:", self.preserve_quality_combo)
209209
layout.addWidget(g_quality)
210210

211+
212+
g_geo = QGroupBox("Geo-Bypass Settings")
213+
g_geo.setMinimumWidth(300)
214+
geo_layout = QFormLayout(g_geo)
215+
geo_layout.setContentsMargins(10, 10, 10, 10)
216+
217+
self.geo_country_combo = QComboBox()
218+
countries = self.parent.user_profile.get_available_geo_bypass_countries()
219+
for code, name in countries.items():
220+
self.geo_country_combo.addItem(f"{name} ({code})", code)
221+
222+
current_country = self.parent.user_profile.get_geo_bypass_country()
223+
for i in range(self.geo_country_combo.count()):
224+
if self.geo_country_combo.itemData(i) == current_country:
225+
self.geo_country_combo.setCurrentIndex(i)
226+
break
227+
228+
self.geo_country_combo.currentIndexChanged.connect(self.geo_country_changed)
229+
self.geo_country_combo.setToolTip(
230+
"Geographic bypass country:\n"
231+
"• US - United States (default, most content)\n"
232+
"• RU - Russia (bypass EU restrictions)\n"
233+
"• DE - Germany (EU region access)\n"
234+
"• GB - United Kingdom (UK content)\n"
235+
"• JP - Japan (Asian content)\n"
236+
"• Other countries for specific regional content\n\n"
237+
"Changes which country's IP is simulated to bypass geo-blocks"
238+
)
239+
240+
geo_layout.addRow("Country:", self.geo_country_combo)
241+
layout.addWidget(g_geo)
242+
211243
# Download Path Group
212244
g_path = QGroupBox("Download Path")
213245
g_path.setMinimumWidth(300)
@@ -388,6 +420,12 @@ def preserve_quality_changed(self, preserve_text):
388420
mode = "enabled" if preserve else "disabled"
389421
self.parent.append_log(f"Quality preservation {mode}")
390422

423+
def geo_country_changed(self, index):
424+
country_code = self.geo_country_combo.itemData(index)
425+
country_name = self.geo_country_combo.currentText()
426+
self.parent.user_profile.set_geo_bypass_country(country_code)
427+
self.parent.append_log(f"Geo-bypass country set to: {country_name}")
428+
391429
def select_download_path(self):
392430
folder = QFileDialog.getExistingDirectory(self, "Select Download Folder")
393431
if folder:

0 commit comments

Comments
 (0)