mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-09 01:50:30 +00:00
feat(hls): add native HLS (m3u8) download protocol (#1515)
This commit is contained in:
56 files changed
+4536
-6
No files matched your search
@@ -65,6 +65,8 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
final _maxRunningController = TextEditingController();
|
||||
final _httpUserAgentController = TextEditingController();
|
||||
final _httpConnectionsController = TextEditingController();
|
||||
final _hlsConnectionsController = TextEditingController();
|
||||
final _hlsMaxRetriesController = TextEditingController();
|
||||
final _btListenPortController = TextEditingController();
|
||||
final _btSeedRatioController = TextEditingController();
|
||||
final _btSeedTimeController = TextEditingController();
|
||||
@@ -96,6 +98,8 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
_maxRunningController,
|
||||
_httpUserAgentController,
|
||||
_httpConnectionsController,
|
||||
_hlsConnectionsController,
|
||||
_hlsMaxRetriesController,
|
||||
_btListenPortController,
|
||||
_btSeedRatioController,
|
||||
_btSeedTimeController,
|
||||
@@ -572,6 +576,32 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
_SettingsBlock(
|
||||
key: const ValueKey('settings-hls-block'),
|
||||
title: 'HLS',
|
||||
child: _SettingsGroup(
|
||||
children: [
|
||||
SettingsItem(
|
||||
title: context.l10n.connections,
|
||||
child: _NumberSettingControl(
|
||||
fieldKey: const ValueKey('hls-connections-input'),
|
||||
controller: _hlsConnectionsController,
|
||||
min: 1,
|
||||
max: 256,
|
||||
),
|
||||
),
|
||||
SettingsItem(
|
||||
title: context.l10n.maxRetries,
|
||||
child: _NumberSettingControl(
|
||||
fieldKey: const ValueKey('hls-max-retries-input'),
|
||||
controller: _hlsMaxRetriesController,
|
||||
min: 0,
|
||||
max: 30,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_SettingsBlock(
|
||||
title: 'BitTorrent',
|
||||
child: _SettingsGroup(
|
||||
@@ -953,6 +983,8 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
_maxRunningController.text = _config!.maxRunning.clamp(1, 256).toString();
|
||||
_httpUserAgentController.text = _config!.protocolConfig.http.userAgent;
|
||||
_httpConnectionsController.text = _config!.protocolConfig.http.connections.clamp(1, 256).toString();
|
||||
_hlsConnectionsController.text = _config!.protocolConfig.hls.segmentConnections.clamp(1, 256).toString();
|
||||
_hlsMaxRetriesController.text = _config!.protocolConfig.hls.maxRetries.clamp(0, 30).toString();
|
||||
_btListenPortController.text = _config!.protocolConfig.bt.listenPort.clamp(0, 65535).toString();
|
||||
_btSeedRatioController.text = _config!.protocolConfig.bt.seedRatio.toString();
|
||||
_btSeedTimeController.text = (_config!.protocolConfig.bt.seedTime ~/ 60).clamp(0, 100000000).toString();
|
||||
@@ -1048,6 +1080,18 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
min: 1,
|
||||
max: 256,
|
||||
);
|
||||
config.protocolConfig.hls.segmentConnections = _boundedInt(
|
||||
_hlsConnectionsController,
|
||||
fallback: config.protocolConfig.hls.segmentConnections,
|
||||
min: 1,
|
||||
max: 256,
|
||||
);
|
||||
config.protocolConfig.hls.maxRetries = _boundedInt(
|
||||
_hlsMaxRetriesController,
|
||||
fallback: config.protocolConfig.hls.maxRetries,
|
||||
min: 0,
|
||||
max: 30,
|
||||
);
|
||||
config.protocolConfig.bt.listenPort = _boundedInt(
|
||||
_btListenPortController,
|
||||
fallback: config.protocolConfig.bt.listenPort,
|
||||
|
||||
Reference in new issue
Block a user