mirror of https://github.com/2dust/v2rayN
Add more subscription url for one group
parent
84eba671f0
commit
b30daf8e56
|
@ -38,7 +38,7 @@ namespace v2rayN
|
|||
Current.Shutdown();
|
||||
Environment.Exit(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Global.processJob = new Job();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Splat;
|
||||
using DynamicData;
|
||||
using Splat;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
@ -163,16 +164,6 @@ namespace v2rayN.Handler
|
|||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
//Turn off system proxy
|
||||
//bool bSysProxyType = false;
|
||||
//if (!blProxy && config.sysProxyType == ESysProxyType.ForcedChange)
|
||||
//{
|
||||
// bSysProxyType = true;
|
||||
// config.sysProxyType = ESysProxyType.ForcedClear;
|
||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||
// Thread.Sleep(3000);
|
||||
//}
|
||||
|
||||
foreach (var item in subItem)
|
||||
{
|
||||
string id = item.id.TrimEx();
|
||||
|
@ -196,16 +187,55 @@ namespace v2rayN.Handler
|
|||
_updateFunc(false, $"{hashCode}{args.GetException().Message}");
|
||||
};
|
||||
|
||||
//idn to idc
|
||||
url = Utils.GetPunycode(url);
|
||||
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgStartGettingSubscriptions}");
|
||||
|
||||
//one url
|
||||
url = Utils.GetPunycode(url);
|
||||
var result = await downloadHandle.TryDownloadString(url, blProxy, userAgent);
|
||||
if (blProxy && Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
result = await downloadHandle.TryDownloadString(url, false, userAgent);
|
||||
}
|
||||
|
||||
//more url
|
||||
if (!Utils.IsNullOrEmpty(item.moreUrl.TrimEx()))
|
||||
{
|
||||
if (!Utils.IsNullOrEmpty(result) && Utils.IsBase64String(result))
|
||||
{
|
||||
result = Utils.Base64Decode(result);
|
||||
}
|
||||
|
||||
var lstUrl = new List<string>
|
||||
{
|
||||
item.moreUrl.TrimEx().Split(",")
|
||||
};
|
||||
foreach (var it in lstUrl)
|
||||
{
|
||||
var url2 = Utils.GetPunycode(it);
|
||||
if (Utils.IsNullOrEmpty(url2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var result2 = await downloadHandle.TryDownloadString(url2, blProxy, userAgent);
|
||||
if (blProxy && Utils.IsNullOrEmpty(result2))
|
||||
{
|
||||
result2 = await downloadHandle.TryDownloadString(url2, false, userAgent);
|
||||
}
|
||||
if (!Utils.IsNullOrEmpty(result2))
|
||||
{
|
||||
if (Utils.IsBase64String(result2))
|
||||
{
|
||||
result += Utils.Base64Decode(result2);
|
||||
}
|
||||
else
|
||||
{
|
||||
result += result2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Utils.IsNullOrEmpty(result))
|
||||
{
|
||||
_updateFunc(false, $"{hashCode}{ResUI.MsgSubscriptionDecodingFailed}");
|
||||
|
@ -231,18 +261,12 @@ namespace v2rayN.Handler
|
|||
}
|
||||
_updateFunc(false, "-------------------------------------------------------");
|
||||
}
|
||||
////restore system proxy
|
||||
//if (bSysProxyType)
|
||||
//{
|
||||
// config.sysProxyType = ESysProxyType.ForcedChange;
|
||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||
//}
|
||||
|
||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void UpdateGeoFile(string geoName, Config config, Action<bool, string> update)
|
||||
{
|
||||
_config = config;
|
||||
|
|
|
@ -6,45 +6,20 @@ namespace v2rayN.Mode
|
|||
public class SubItem
|
||||
{
|
||||
[PrimaryKey]
|
||||
public string id
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string remarks
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string remarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// url
|
||||
/// </summary>
|
||||
public string url
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string url { get; set; }
|
||||
|
||||
public string moreUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// enable
|
||||
/// </summary>
|
||||
public bool enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string userAgent
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
public string userAgent { get; set; } = string.Empty;
|
||||
|
||||
public int sort { get; set; }
|
||||
|
||||
public int sort
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string filter { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -420,6 +420,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 More urls, separated by commas 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string LvMoreUrl {
|
||||
get {
|
||||
return ResourceManager.GetString("LvMoreUrl", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Port 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -564,15 +573,6 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Medium 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string MediumFresh {
|
||||
get {
|
||||
return ResourceManager.GetString("MediumFresh", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add a custom configuration server 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -1671,15 +1671,6 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Fast 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string QuickFresh {
|
||||
get {
|
||||
return ResourceManager.GetString("QuickFresh", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Global hotkey {0} registered failed, reason {1} 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -1762,20 +1753,11 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Slow 的本地化字符串。
|
||||
/// 查找类似 {0}:{1}/s↑ | {2}/s↓ 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string SlowFresh {
|
||||
public static string SpeedDisplayText {
|
||||
get {
|
||||
return ResourceManager.GetString("SlowFresh", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing. 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string SpeedServerTips {
|
||||
get {
|
||||
return ResourceManager.GetString("SpeedServerTips", resourceCulture);
|
||||
return ResourceManager.GetString("SpeedDisplayText", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -228,9 +228,6 @@
|
|||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>جابجایی</value>
|
||||
</data>
|
||||
<data name="MediumFresh" xml:space="preserve">
|
||||
<value>متوسط</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>محتوای اشتراک اصلی را پاک کنید</value>
|
||||
</data>
|
||||
|
@ -315,9 +312,6 @@
|
|||
<data name="PleaseSelectServer" xml:space="preserve">
|
||||
<value>لطفا ابتدا سرور را انتخاب کنید</value>
|
||||
</data>
|
||||
<data name="QuickFresh" xml:space="preserve">
|
||||
<value>سریع</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
||||
</data>
|
||||
|
@ -330,12 +324,6 @@
|
|||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||
<value>The server configuration file is saved at: {0}</value>
|
||||
</data>
|
||||
<data name="SlowFresh" xml:space="preserve">
|
||||
<value>آهسته. تدریجی</value>
|
||||
</data>
|
||||
<data name="SpeedServerTips" xml:space="preserve">
|
||||
<value>توجه: این ویژگی به پروکسی جهانی Http متکی است. لطفاً پس از آزمایش، پراکسی جهانی Http و گره فعال را به صورت دستی تنظیم کنید.</value>
|
||||
</data>
|
||||
<data name="StartPacFailed" xml:space="preserve">
|
||||
<value>PAC شروع نشد. لطفا این برنامه را به عنوان Administrator اجرا کنید.</value>
|
||||
</data>
|
||||
|
|
|
@ -228,9 +228,6 @@
|
|||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>Transport</value>
|
||||
</data>
|
||||
<data name="MediumFresh" xml:space="preserve">
|
||||
<value>Medium</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Clear original subscription content</value>
|
||||
</data>
|
||||
|
@ -315,9 +312,6 @@
|
|||
<data name="PleaseSelectServer" xml:space="preserve">
|
||||
<value>Please select the server first</value>
|
||||
</data>
|
||||
<data name="QuickFresh" xml:space="preserve">
|
||||
<value>Fast</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>Servers deduplication completed. Old: {0}, New: {1}.</value>
|
||||
</data>
|
||||
|
@ -330,12 +324,6 @@
|
|||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||
<value>The server configuration file is saved at: {0}</value>
|
||||
</data>
|
||||
<data name="SlowFresh" xml:space="preserve">
|
||||
<value>Slow</value>
|
||||
</data>
|
||||
<data name="SpeedServerTips" xml:space="preserve">
|
||||
<value>Note: This feature relies on the Http global proxy. Please manually adjust the Http global proxy and active node after testing.</value>
|
||||
</data>
|
||||
<data name="StartPacFailed" xml:space="preserve">
|
||||
<value>PAC failed to start. Please run this program as Administrator.</value>
|
||||
</data>
|
||||
|
@ -1156,4 +1144,10 @@
|
|||
<data name="menuRebootAsAdmin" xml:space="preserve">
|
||||
<value>Reboot as administrator</value>
|
||||
</data>
|
||||
<data name="LvMoreUrl" xml:space="preserve">
|
||||
<value>More urls, separated by commas</value>
|
||||
</data>
|
||||
<data name="SpeedDisplayText" xml:space="preserve">
|
||||
<value>{0}:{1}/s↑ | {2}/s↓</value>
|
||||
</data>
|
||||
</root>
|
|
@ -228,9 +228,6 @@
|
|||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>Протокол</value>
|
||||
</data>
|
||||
<data name="MediumFresh" xml:space="preserve">
|
||||
<value>Medium</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>Очистить контент оригинальной подписки</value>
|
||||
</data>
|
||||
|
@ -315,9 +312,6 @@
|
|||
<data name="PleaseSelectServer" xml:space="preserve">
|
||||
<value>Сначала выберите сервер</value>
|
||||
</data>
|
||||
<data name="QuickFresh" xml:space="preserve">
|
||||
<value>Быстрый</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>Удаление дублей завершено. Старая: {0}, Новая: {1}.</value>
|
||||
</data>
|
||||
|
@ -330,12 +324,6 @@
|
|||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||
<value>Файл конфигурации сервера сохранен по адресу: {0}</value>
|
||||
</data>
|
||||
<data name="SlowFresh" xml:space="preserve">
|
||||
<value>Медленный</value>
|
||||
</data>
|
||||
<data name="SpeedServerTips" xml:space="preserve">
|
||||
<value>Примечание. Эта функция зависит от глобального прокси-сервера HTTP. После тестирования вручную настройте глобальный прокси-сервер HTTP и активный узел.</value>
|
||||
</data>
|
||||
<data name="StartPacFailed" xml:space="preserve">
|
||||
<value>PAC не удалось запустить. Пожалуйста, запустите эту программу от имени администратора.</value>
|
||||
</data>
|
||||
|
|
|
@ -228,9 +228,6 @@
|
|||
<data name="LvTransportProtocol" xml:space="preserve">
|
||||
<value>传输协议</value>
|
||||
</data>
|
||||
<data name="MediumFresh" xml:space="preserve">
|
||||
<value>中等</value>
|
||||
</data>
|
||||
<data name="MsgClearSubscription" xml:space="preserve">
|
||||
<value>清除原订阅内容</value>
|
||||
</data>
|
||||
|
@ -315,9 +312,6 @@
|
|||
<data name="PleaseSelectServer" xml:space="preserve">
|
||||
<value>请先选择服务器</value>
|
||||
</data>
|
||||
<data name="QuickFresh" xml:space="preserve">
|
||||
<value>快</value>
|
||||
</data>
|
||||
<data name="RemoveDuplicateServerResult" xml:space="preserve">
|
||||
<value>服务器去重完成。原数量: {0},现数量: {1}</value>
|
||||
</data>
|
||||
|
@ -330,12 +324,6 @@
|
|||
<data name="SaveServerConfigurationIn" xml:space="preserve">
|
||||
<value>服务端配置文件保存在:{0}</value>
|
||||
</data>
|
||||
<data name="SlowFresh" xml:space="preserve">
|
||||
<value>慢</value>
|
||||
</data>
|
||||
<data name="SpeedServerTips" xml:space="preserve">
|
||||
<value>注意:此功能依赖Http全局代理!测试完成后,请手工调整Http全局代理和活动节点。</value>
|
||||
</data>
|
||||
<data name="StartPacFailed" xml:space="preserve">
|
||||
<value>PAC服务启动失败,请用管理员启动</value>
|
||||
</data>
|
||||
|
@ -1156,4 +1144,7 @@
|
|||
<data name="menuRebootAsAdmin" xml:space="preserve">
|
||||
<value>以管理员身份重启</value>
|
||||
</data>
|
||||
<data name="LvMoreUrl" xml:space="preserve">
|
||||
<value>更多地址(url),用逗号隔开</value>
|
||||
</data>
|
||||
</root>
|
|
@ -429,6 +429,11 @@ namespace v2rayN
|
|||
BitmapSizeOptions.FromEmptyOptions());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idn to idc
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetPunycode(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace v2rayN.ViewModels
|
|||
public ReactiveCommand<Unit, Unit> OptionSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RoutingSettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> GlobalHotkeySettingCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> RebootAsAdminCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ClearServerStatisticsCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> ImportOldGuiConfigCmd { get; }
|
||||
|
||||
|
@ -568,8 +568,9 @@ namespace v2rayN.ViewModels
|
|||
{
|
||||
return;
|
||||
}
|
||||
SpeedProxyDisplay = string.Format("{0}:{1}/s<><73> | {2}/s<><73>", Global.agentTag, Utils.HumanFy(update.proxyUp), Utils.HumanFy(update.proxyDown));
|
||||
SpeedDirectDisplay = string.Format("{0}:{1}/s<><73> | {2}/s<><73>", Global.directTag, Utils.HumanFy(update.directUp), Utils.HumanFy(update.directDown));
|
||||
|
||||
SpeedProxyDisplay = string.Format(ResUI.SpeedDisplayText, Global.agentTag, Utils.HumanFy(update.proxyUp), Utils.HumanFy(update.proxyDown));
|
||||
SpeedDirectDisplay = string.Format(ResUI.SpeedDisplayText, Global.directTag, Utils.HumanFy(update.directUp), Utils.HumanFy(update.directDown));
|
||||
|
||||
if (update.proxyUp + update.proxyDown > 0)
|
||||
{
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace v2rayN.ViewModels
|
|||
{
|
||||
item.remarks = SelectedSource.remarks;
|
||||
item.url = SelectedSource.url;
|
||||
item.moreUrl = SelectedSource.moreUrl;
|
||||
item.enabled = SelectedSource.enabled;
|
||||
item.userAgent = SelectedSource.userAgent;
|
||||
item.sort = SelectedSource.sort;
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
TextOptions.TextRenderingMode="Auto"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Popupbox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
|
||||
<ScrollViewer
|
||||
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
|
@ -45,6 +53,7 @@
|
|||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
|
@ -92,6 +101,31 @@
|
|||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<materialDesign:PopupBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
StaysOpen="True"
|
||||
Style="{StaticResource MaterialDesignToolForegroundPopupBox}">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.LvMoreUrl}" />
|
||||
<TextBox
|
||||
x:Name="txtMoreUrl"
|
||||
Width="400"
|
||||
Margin="4"
|
||||
VerticalAlignment="Top"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
|
||||
AcceptsReturn="True"
|
||||
MinLines="4"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</materialDesign:PopupBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace v2rayN.Views
|
|||
{
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.remarks, v => v.txtRemarks.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.url, v => v.txtUrl.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.moreUrl, v => v.txtMoreUrl.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.enabled, v => v.togEnable.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.userAgent, v => v.txtUserAgent.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.sort, v => v.txtSort.Text).DisposeWith(disposables);
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
Binding="{Binding url}"
|
||||
Header="{x:Static resx:ResUI.LvUrl}" />
|
||||
<DataGridTextColumn
|
||||
Width="80"
|
||||
Width="100"
|
||||
Binding="{Binding enabled}"
|
||||
Header="{x:Static resx:ResUI.LvEnabled}" />
|
||||
<DataGridTextColumn
|
||||
|
|
Loading…
Reference in New Issue