Skip to content

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
  • Loading branch information
kaedei committed Jun 21, 2020
1 parent c4c5fcc commit 6c30831
Show file tree
Hide file tree
Showing 28 changed files with 588 additions and 2 deletions.
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# dandanplay-resmonitor
【弹弹play资源监视器】一个动漫资源自动监视+下载的小工具,接入了弹弹play服务器端API
# 弹弹play资源监视器 dandanplay-resmonitor

## 一、介绍

### 一句话简介

这是一个动漫资源自动监视+下载的小工具,并接入了弹弹play服务器端API。

### 它能做什么

此工具模拟了 [弹弹play播放器](http://www.dandanplay.com/) Windows版上的“自动下载”功能,能够根据设定好的监视规则自动检测网上是否有新的资源发布,当发现新的资源后自动通知下载工具新建任务并开始下载。

### 技术选型

此工具使用 `ASP.NET Core` 技术编写,编程语言使用了 `C#`

选择 `ASP.NET Core` 的原因主要是支持直接打包成exe双击运行在本机系统中,也可以通过 `dotnet` 命令行直接启动dll,还支持打包进docker镜像运行。支持的操作系统包括:Windows 10, Windows Server Core(以及 Windows Container), Linux, macOS。

### 开发工具

本项目使用 macOS 10.15 下的 `Jetbrains Rider` IDE 进行开发。SDK版本目前为 .NET Core SDK 3.1.100。

### 付费

是的,为了补贴各种日常开销,本工具虽是开源产品,但需要赞助作者后才能使用。

本工具内部连接了弹弹play服务器端API,试用期结束后,您需要赞助作者才可以持续使用。赞助方式将通过 [爱发电项目页](https://afdian.net/@kaedei) 进行(__现在还没有开始接受赞助!__)。

对于此工具的新用户,将会在您第一次使用弹弹play登录后向您赠送7天的免费试用时间。

## 二、怎样使用

### 在弹弹play客户端上注册用户并创建规则

TODO

### 本机(PC)运行

TODO

### docker镜像部署(Linux)

TODO

### docker镜像部署(Windows Container)

TODO

## 三、开发者相关

### 配置开发环境

TODO
2 changes: 2 additions & 0 deletions ResourceMonitor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appsettings.Development.json
log
Empty file.
2 changes: 2 additions & 0 deletions ResourceMonitor/.idea/.idea.ResourceMonitor/.idea/.gitignore

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

57 changes: 57 additions & 0 deletions ResourceMonitor/.idea/.idea.ResourceMonitor/.idea/contentModel.xml

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

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

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

8 changes: 8 additions & 0 deletions ResourceMonitor/.idea/.idea.ResourceMonitor/.idea/modules.xml

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

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

6 changes: 6 additions & 0 deletions ResourceMonitor/.idea/.idea.ResourceMonitor/.idea/vcs.xml

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

7 changes: 7 additions & 0 deletions ResourceMonitor/.idea/.idea.ResourceMonitor/riderModule.iml

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

16 changes: 16 additions & 0 deletions ResourceMonitor/ResourceMonitor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceMonitor", "ResourceMonitor\ResourceMonitor.csproj", "{6803E3E6-61BA-4DB0-BD0C-1A810D493E9C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6803E3E6-61BA-4DB0-BD0C-1A810D493E9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6803E3E6-61BA-4DB0-BD0C-1A810D493E9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6803E3E6-61BA-4DB0-BD0C-1A810D493E9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6803E3E6-61BA-4DB0-BD0C-1A810D493E9C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using ResourceMonitor.Models;

namespace ResourceMonitor.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

private readonly ILogger<WeatherForecastController> _logger;

public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}

[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;

namespace ResourceMonitor.Models.DandanplayApi
{
/*
* {
"id": "string",
"description": "string",
"keyword": "string",
"subgroupId": 0,
"typeId": 0,
"maxCount": 0,
"autoStart": true,
"createdTime": "2020-06-21T09:30:22.124Z",
"startTime": "2020-06-21T09:30:22.124Z",
"subgroupName": "string",
"typeName": "string",
"chooseNewerIfDuplicate": true,
"limitFileSize": 0,
"version": 0,
"isShared": true
}
*/

/// <summary>
/// 下载规则详情(部分属性没有用到就没加进来)
/// </summary>
public class AutoDownloadRule
{
public string id { get; set; }
public string description { get; set; }
public string keyword { get; set; }
public int subgroupId { get; set; }
public int typeId { get; set; }
public int maxCount { get; set; }
public bool autoStart { get; set; }
public DateTime createdTime { get; set; }
public string subgroupName { get; set; }
public string typeName { get; set; }
public bool chooseNewerIfDuplicate { get; set; }
public int limitFileSize { get; set; }
public int version { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ResourceMonitor.Models.DandanplayApi
{
public class AutoDownloadRuleListResponse : ResponseBase
{
public AutoDownloadRule[] rules { get; set; }
public string[] removedRuleIds { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ResourceMonitor.Models.DandanplayApi
{
public class AutoDownloadRuleSyncRequest
{
public string[] currentRuleIds { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace ResourceMonitor.Models.DandanplayApi
{
public class LoginRequest
{
public string userName { get; set; }
public string password { get; set; }
public string appId { get; set; }
public long unixTimestamp { get; set; }
public string hash { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;

namespace ResourceMonitor.Models.DandanplayApi
{
/*
{
"registerRequired": true,
"userId": 0,
"userName": "string",
"legacyTokenNumber": 0,
"token": "string",
"tokenExpireTime": "2020-06-21T09:30:21.927Z",
"userType": "string",
"screenName": "string",
"profileImage": "string",
"appScope": "string",
"errorCode": 0,
"success": true,
"errorMessage": "string"
}
*
*
*/
public class LoginResponse : ResponseBase
{
public bool registerRequired { get; set; }
public int userId { get; set; }
public string userName { get; set; }
public string token { get; set; }
public DateTime tokenExpireTime { get; set; }
public string userType { get; set; }
public string screenName { get; set; }
public string appScope { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ResourceMonitor.Models.DandanplayApi
{
public class ResponseBase
{
public int errorCode { get; set; }
public bool success { get; set; }
public string errorMessage { get; set; }
}
}
15 changes: 15 additions & 0 deletions ResourceMonitor/ResourceMonitor/Models/WeatherForecast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace ResourceMonitor.Models
{
public class WeatherForecast
{
public DateTime Date { get; set; }

public int TemperatureC { get; set; }

public int TemperatureF => 32 + (int) (TemperatureC / 0.5556);

public string Summary { get; set; }
}
}
Loading

0 comments on commit 6c30831

Please sign in to comment.