Skip to content

Commit

Permalink
添加批量导入BT种子功能
Browse files Browse the repository at this point in the history
  • Loading branch information
jjling2011 committed Apr 13, 2022
1 parent fb142ad commit 3d17004
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 130 deletions.
53 changes: 5 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,11 @@
# AriaNg
[![License](https://img.shields.io/github/license/mayswind/AriaNg.svg?style=flat)](https://github.com/mayswind/AriaNg/blob/master/LICENSE)
[![Lastest Build](https://img.shields.io/circleci/project/github/mayswind/AriaNg.svg?style=flat)](https://circleci.com/gh/mayswind/AriaNg/tree/master)
[![Lastest Release](https://img.shields.io/github/release/mayswind/AriaNg.svg?style=flat)](https://github.com/mayswind/AriaNg/releases)
# AriaNgMod
[![License](https://img.shields.io/github/license/jjling2011/AriaNgMod.svg?style=flat)](https://github.com/jjling2011/AriaNgMod/blob/master/LICENSE)

## Introduction
AriaNg is a modern web frontend making [aria2](https://github.com/aria2/aria2) easier to use. AriaNg is written in pure html & javascript, thus it does not need any compilers or runtime environment. You can just put AriaNg in your web server and open it in your browser. AriaNg uses responsive layout, and supports any desktop or mobile devices.

## Features
1. Pure Html & Javascript, no runtime required
2. Responsive design, supporting desktop and mobile devices
3. User-friendly interface
* Sort tasks (by name, size, progress, remaining time, download speed, etc.), files, bittorrent peers
* Search tasks
* Retry tasks
* Adjust task order by dragging
* More information of tasks (health percentage, client information of bt peers, etc.)
* Filter files by specified file types (videos, audios, pictures, documents, applications, archives, etc.) or file extensions
* Tree view for multi-directory task
* Download / upload speed chart for aria2 or single task
* Full support for aria2 settings
4. Dark theme
5. Url command line api support
6. Download finished notification
7. Multi-languages support
8. Multi aria2 RPC host support
9. Exporting and Importing settings support
10. Less bandwidth usage, only requesting incremental data

## Screenshots
#### Desktop
![AriaNg](https://raw.githubusercontent.com/mayswind/AriaNg-WebSite/master/screenshots/desktop.png)
#### Mobile Device
![AriaNg](https://raw.githubusercontent.com/mayswind/AriaNg-WebSite/master/screenshots/mobile.png)

## Installation
AriaNg now provides three versions, standard version, all-in-one version and [AriaNg Native](https://github.com/mayswind/AriaNg-Native). Standard version is suitable for deployment in the web server, and provides on-demand loading. All-In-One version is suitable for local using, and you can download it and just open the only html file in browser. [AriaNg Native](https://github.com/mayswind/AriaNg-Native) is also suitable for local using, and is no need for browser.
AriaNgMod是[AriaNg](https://github.com/mayswind/AriaNg) v1.2.3的修改版。主要添加批量导入BT种子功能。

#### Prebuilt release
Latest Release: [https://github.com/mayswind/AriaNg/releases](https://github.com/mayswind/AriaNg/releases)

Latest Daily Build (Standard Version): [https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip](https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip)
Latest Release: [https://github.com/jjling2011/AriaNgMod/releases](https://github.com/jjling2011/AriaNgMod/releases)

#### Building from source
Make sure you have [Node.js](https://nodejs.org/), [NPM](https://www.npmjs.com/) and [Gulp](https://gulpjs.com/) installed. Then download the source code, and follow these steps.
Expand All @@ -56,18 +22,9 @@ Make sure you have [Node.js](https://nodejs.org/), [NPM](https://www.npmjs.com/)

The builds will be placed in the dist directory.

#### Usage Notes
Since AriaNg standard version loads language resources asynchronously, you may not open index.html directly on the local file system to run AriaNg. It is recommended that you can use the all-in-one version or deploy AriaNg in a web container or download [AriaNg Native](https://github.com/mayswind/AriaNg-Native) that does not require a browser to run.

## Documents
1. [English](http://ariang.mayswind.net)
2. [Simplified Chinese (简体中文)](http://ariang.mayswind.net/zh_Hans)

## Demo
Please visit [http://ariang.mayswind.net/latest](http://ariang.mayswind.net/latest)

## Third Party Extensions
There are some third-party applications based on AriaNg, so you can use AriaNg in more scenarios or devices. Please visit [Third Party Extensions](http://ariang.mayswind.net/3rd-extensions.html) for more information.

## License
[MIT](https://github.com/mayswind/AriaNg/blob/master/LICENSE)
[MIT](https://github.com/jjling2011/AriaNg/blob/master/LICENSE)
75 changes: 25 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/langs/zh_Hans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Download Links:=下载链接:
Download Now=立即下载
Download Later=手动下载
Open Torrent File=打开种子文件
Open Torrent Files=打开多个种子文件
Open Metalink File=打开 Metalink 文件
Support multiple URLs, one URL per line.=支持多个 URL 地址, 每个地址占一行.
Your browser does not support loading file!=您的浏览器不支持加载文件!
Expand Down
1 change: 1 addition & 0 deletions src/langs/zh_Hant.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Download Links:=下載連結:
Download Now=立即下載
Download Later=手動下載
Open Torrent File=打開種子檔案
Open Torrent Files=打開多個種子檔案
Open Metalink File=打開 Metalink 檔案
Support multiple URLs, one URL per line.=支援多個 URL 位址, 每個位址佔一行.
Your browser does not support loading file!=您的瀏覽器不支援載入檔案!
Expand Down
51 changes: 43 additions & 8 deletions src/scripts/controllers/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,24 @@
};

var downloadByTorrent = function (pauseOnAdded, responseCallback) {
var task = {
content: $scope.context.uploadFile.base64Content,
options: angular.copy($scope.context.options)
};

saveDownloadPath(task.options);
var options = angular.copy($scope.context.options);
saveDownloadPath(options);

return aria2TaskService.newTorrentTask(task, pauseOnAdded, responseCallback);
var num = $scope.context.uploadFile.length;
var blackHole = function () { };

for (var i = 0; i < num; i++) {
var task = {
content: $scope.context.uploadFile[i].base64Content,
options: options
};
if (i < num - 1) {
$rootScope.loadPromise = aria2TaskService.newTorrentTask(task, pauseOnAdded, blackHole);
} else {
return aria2TaskService.newTorrentTask(task, pauseOnAdded, responseCallback);
}
};
};

var downloadByMetalink = function (pauseOnAdded, responseCallback) {
Expand Down Expand Up @@ -133,14 +143,39 @@
fileFilter: '.torrent',
fileType: 'binary'
}, function (result) {
$scope.context.uploadFile = result;
$scope.context.uploadFile = [result];
$scope.context.taskType = 'torrent';
$scope.changeTab('options');
}, function (error) {
ariaNgLocalizationService.showError(error);
}, angular.element('#file-holder'));
};

$scope.openTorrents = function () {

var torrentFiles = [];

ariaNgFileService.openMultipleFileContents({
scope: $scope,
fileFilter: '.torrent',
fileType: 'binary'
}, function (result, readNextFile) {

torrentFiles.push(result);

if (readNextFile) {
readNextFile();
} else {
// read file finished
$scope.context.taskType = 'torrent';
$scope.context.uploadFile = torrentFiles;
$scope.changeTab('options');
}
}, function (error) {
ariaNgLocalizationService.showError(error);
}, angular.element('#multiple-files-holder'));
};

$scope.openMetalink = function () {
ariaNgFileService.openFileContent({
scope: $scope,
Expand Down Expand Up @@ -210,6 +245,6 @@
return urls ? urls.length : 0;
};

$rootScope.loadPromise = $timeout(function () {}, 100);
$rootScope.loadPromise = $timeout(function () { }, 100);
}]);
}());
Loading

0 comments on commit 3d17004

Please sign in to comment.