├── .gitignore ├── DD播放器.sln ├── DD监控室 ├── App.config ├── DDTV.ico ├── DD监控室.csproj ├── DM_System │ ├── .project │ ├── dist │ │ ├── CommentCoreLibrary.js │ │ ├── CommentCoreLibrary.min.js │ │ ├── css │ │ │ ├── style.css │ │ │ └── style.min.css │ │ └── scripting │ │ │ ├── Host.js │ │ │ ├── OOAPI.js │ │ │ ├── Worker.js │ │ │ └── api │ │ │ ├── Display.js │ │ │ ├── Function.js │ │ │ ├── Global.js │ │ │ ├── Player.js │ │ │ ├── Runtime.js │ │ │ ├── Tween.js │ │ │ └── Utils.js │ ├── index.html │ ├── main.js │ └── my-page-styles.css ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── MMPU.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── RecordForm.Designer.cs ├── RecordForm.cs ├── RecordForm.resx ├── Room.cs ├── RoomListConfig.ini ├── VLCAPI.cs ├── VLCPlayer.cs ├── VLCUtil.cs ├── Ver.cs ├── getUriSteam.cs ├── new.ini ├── obj │ └── Debug │ │ ├── DD监控室.Form1.resources │ │ ├── DD监控室.Properties.Resources.resources │ │ ├── DD监控室.csproj.CopyComplete │ │ ├── DD监控室.csproj.CoreCompileInputs.cache │ │ ├── DD监控室.csproj.FileListAbsolute.txt │ │ ├── DD监控室.csproj.GenerateResource.Cache │ │ ├── DD监控室.exe │ │ ├── DD监控室.pdb │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── packages.config └── ver.ini ├── DmWin ├── App.config ├── App.xaml ├── App.xaml.cs ├── DmWin.csproj ├── MMPU.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Window1.xaml ├── Window1.xaml.cs └── packages.config ├── LICENSE ├── MPUCL ├── App.config ├── MMPU.cs ├── MPUCL.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Room.cs ├── Ver.cs ├── WebClientto.cs └── getUriSteam.CS ├── README.md └── src ├── 1.png ├── 2.png ├── 4.png ├── 5.png ├── DDTV.png ├── Ver.ini ├── Ver_Text.ini ├── WX.png └── ZFB.png /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/csharp 3 | # Edit at https://www.gitignore.io/?templates=csharp 4 | 5 | ### Csharp ### 6 | ## Ignore Visual Studio temporary files, build results, and 7 | ## files generated by popular Visual Studio add-ons. 8 | ## 9 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 10 | 11 | # User-specific files 12 | *.rsuser 13 | *.suo 14 | *.user 15 | *.userosscache 16 | *.sln.docstates 17 | 18 | # User-specific files (MonoDevelop/Xamarin Studio) 19 | *.userprefs 20 | 21 | # Build results 22 | [Dd]ebug/ 23 | [Dd]ebugPublic/ 24 | [Rr]elease/ 25 | [Rr]eleases/ 26 | x64/ 27 | x86/ 28 | [Aa][Rr][Mm]/ 29 | [Aa][Rr][Mm]64/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | [Ll]og/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUNIT 48 | *.VisualState.xml 49 | TestResult.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # JustCode is a .NET coding add-in 131 | .JustCode 132 | 133 | # TeamCity is a build add-in 134 | _TeamCity* 135 | 136 | # DotCover is a Code Coverage Tool 137 | *.dotCover 138 | 139 | # AxoCover is a Code Coverage Tool 140 | .axoCover/* 141 | !.axoCover/settings.json 142 | 143 | # Visual Studio code coverage results 144 | *.coverage 145 | *.coveragexml 146 | 147 | # NCrunch 148 | _NCrunch_* 149 | .*crunch*.local.xml 150 | nCrunchTemp_* 151 | 152 | # MightyMoose 153 | *.mm.* 154 | AutoTest.Net/ 155 | 156 | # Web workbench (sass) 157 | .sass-cache/ 158 | 159 | # Installshield output folder 160 | [Ee]xpress/ 161 | 162 | # DocProject is a documentation generator add-in 163 | DocProject/buildhelp/ 164 | DocProject/Help/*.HxT 165 | DocProject/Help/*.HxC 166 | DocProject/Help/*.hhc 167 | DocProject/Help/*.hhk 168 | DocProject/Help/*.hhp 169 | DocProject/Help/Html2 170 | DocProject/Help/html 171 | 172 | # Click-Once directory 173 | publish/ 174 | 175 | # Publish Web Output 176 | *.[Pp]ublish.xml 177 | *.azurePubxml 178 | # Note: Comment the next line if you want to checkin your web deploy settings, 179 | # but database connection strings (with potential passwords) will be unencrypted 180 | *.pubxml 181 | *.publishproj 182 | 183 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 184 | # checkin your Azure Web App publish settings, but sensitive information contained 185 | # in these scripts will be unencrypted 186 | PublishScripts/ 187 | 188 | # NuGet Packages 189 | *.nupkg 190 | # The packages folder can be ignored because of Package Restore 191 | **/[Pp]ackages/* 192 | # except build/, which is used as an MSBuild target. 193 | !**/[Pp]ackages/build/ 194 | # Uncomment if necessary however generally it will be regenerated when needed 195 | #!**/[Pp]ackages/repositories.config 196 | # NuGet v3's project.json files produces more ignorable files 197 | *.nuget.props 198 | *.nuget.targets 199 | 200 | # Microsoft Azure Build Output 201 | csx/ 202 | *.build.csdef 203 | 204 | # Microsoft Azure Emulator 205 | ecf/ 206 | rcf/ 207 | 208 | # Windows Store app package directories and files 209 | AppPackages/ 210 | BundleArtifacts/ 211 | Package.StoreAssociation.xml 212 | _pkginfo.txt 213 | *.appx 214 | 215 | # Visual Studio cache files 216 | # files ending in .cache can be ignored 217 | *.[Cc]ache 218 | # but keep track of directories ending in .cache 219 | !?*.[Cc]ache/ 220 | 221 | # Others 222 | ClientBin/ 223 | ~$* 224 | *~ 225 | *.dbmdl 226 | *.dbproj.schemaview 227 | *.jfm 228 | *.pfx 229 | *.publishsettings 230 | orleans.codegen.cs 231 | 232 | # Including strong name files can present a security risk 233 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 234 | #*.snk 235 | 236 | # Since there are multiple workflows, uncomment next line to ignore bower_components 237 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 238 | #bower_components/ 239 | # ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true 240 | **/wwwroot/lib/ 241 | 242 | # RIA/Silverlight projects 243 | Generated_Code/ 244 | 245 | # Backup & report files from converting an old project file 246 | # to a newer Visual Studio version. Backup files are not needed, 247 | # because we have git ;-) 248 | _UpgradeReport_Files/ 249 | Backup*/ 250 | UpgradeLog*.XML 251 | UpgradeLog*.htm 252 | ServiceFabricBackup/ 253 | *.rptproj.bak 254 | 255 | # SQL Server files 256 | *.mdf 257 | *.ldf 258 | *.ndf 259 | 260 | # Business Intelligence projects 261 | *.rdl.data 262 | *.bim.layout 263 | *.bim_*.settings 264 | *.rptproj.rsuser 265 | *- Backup*.rdl 266 | 267 | # Microsoft Fakes 268 | FakesAssemblies/ 269 | 270 | # GhostDoc plugin setting file 271 | *.GhostDoc.xml 272 | 273 | # Node.js Tools for Visual Studio 274 | .ntvs_analysis.dat 275 | node_modules/ 276 | 277 | # Visual Studio 6 build log 278 | *.plg 279 | 280 | # Visual Studio 6 workspace options file 281 | *.opt 282 | 283 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 284 | *.vbw 285 | 286 | # Visual Studio LightSwitch build output 287 | **/*.HTMLClient/GeneratedArtifacts 288 | **/*.DesktopClient/GeneratedArtifacts 289 | **/*.DesktopClient/ModelManifest.xml 290 | **/*.Server/GeneratedArtifacts 291 | **/*.Server/ModelManifest.xml 292 | _Pvt_Extensions 293 | 294 | # Paket dependency manager 295 | .paket/paket.exe 296 | paket-files/ 297 | 298 | # FAKE - F# Make 299 | .fake/ 300 | 301 | # JetBrains Rider 302 | .idea/ 303 | *.sln.iml 304 | 305 | # CodeRush personal settings 306 | .cr/personal 307 | 308 | # Python Tools for Visual Studio (PTVS) 309 | __pycache__/ 310 | *.pyc 311 | 312 | # Cake - Uncomment if you are using it 313 | # tools/** 314 | # !tools/packages.config 315 | 316 | # Tabs Studio 317 | *.tss 318 | 319 | # Telerik's JustMock configuration file 320 | *.jmconfig 321 | 322 | # BizTalk build output 323 | *.btp.cs 324 | *.btm.cs 325 | *.odx.cs 326 | *.xsd.cs 327 | 328 | # OpenCover UI analysis results 329 | OpenCover/ 330 | 331 | # Azure Stream Analytics local run output 332 | ASALocalRun/ 333 | 334 | # MSBuild Binary and Structured Log 335 | *.binlog 336 | 337 | # NVidia Nsight GPU debugger configuration file 338 | *.nvuser 339 | 340 | # MFractors (Xamarin productivity tool) working folder 341 | .mfractor/ 342 | 343 | # Local History for Visual Studio 344 | .localhistory/ 345 | 346 | # BeatPulse healthcheck temp database 347 | healthchecksdb 348 | 349 | # End of https://www.gitignore.io/api/csharp -------------------------------------------------------------------------------- /DD播放器.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DD监控室", "DD监控室\DD监控室.csproj", "{60FAAB44-24A1-48B7-B728-CE257E4C9DE5}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DmWin", "DmWin\DmWin.csproj", "{6D7451C6-E747-4790-A32A-E394E062F090}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPUCL", "MPUCL\MPUCL.csproj", "{EF042CE7-004D-4271-AA32-8C51462F57D4}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x86 = Debug|x86 16 | Release|Any CPU = Release|Any CPU 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Debug|x86.ActiveCfg = Debug|x86 23 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Debug|x86.Build.0 = Debug|x86 24 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Release|x86.ActiveCfg = Release|x86 27 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5}.Release|x86.Build.0 = Release|x86 28 | {6D7451C6-E747-4790-A32A-E394E062F090}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {6D7451C6-E747-4790-A32A-E394E062F090}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {6D7451C6-E747-4790-A32A-E394E062F090}.Debug|x86.ActiveCfg = Debug|x86 31 | {6D7451C6-E747-4790-A32A-E394E062F090}.Debug|x86.Build.0 = Debug|x86 32 | {6D7451C6-E747-4790-A32A-E394E062F090}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {6D7451C6-E747-4790-A32A-E394E062F090}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {6D7451C6-E747-4790-A32A-E394E062F090}.Release|x86.ActiveCfg = Release|x86 35 | {6D7451C6-E747-4790-A32A-E394E062F090}.Release|x86.Build.0 = Release|x86 36 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Debug|x86.ActiveCfg = Debug|Any CPU 39 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Debug|x86.Build.0 = Debug|Any CPU 40 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Release|x86.ActiveCfg = Release|x86 43 | {EF042CE7-004D-4271-AA32-8C51462F57D4}.Release|x86.Build.0 = Release|x86 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {D245D745-148D-48BF-BCF5-85F40D05AFFD} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /DD监控室/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DD监控室/DDTV.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/DDTV.ico -------------------------------------------------------------------------------- /DD监控室/DD监控室.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {60FAAB44-24A1-48B7-B728-CE257E4C9DE5} 8 | WinExe 9 | DD监控室 10 | DD监控室 11 | v4.7.1 12 | 512 13 | true 14 | false 15 | Y:\DDTV\ 16 | true 17 | Disk 18 | false 19 | Foreground 20 | 7 21 | Days 22 | false 23 | false 24 | true 25 | true 26 | 5 27 | 1.0.1.%2a 28 | false 29 | true 30 | true 31 | 32 | 33 | x86 34 | true 35 | full 36 | false 37 | bin\Debug\ 38 | DEBUG;TRACE 39 | prompt 40 | 4 41 | 42 | 43 | AnyCPU 44 | pdbonly 45 | true 46 | bin\Release\ 47 | TRACE 48 | prompt 49 | 4 50 | 51 | 52 | DDTV.ico 53 | 54 | 55 | true 56 | bin\x86\Debug\ 57 | DEBUG;TRACE 58 | full 59 | x86 60 | prompt 61 | MinimumRecommendedRules.ruleset 62 | true 63 | 64 | 65 | bin\x86\Release\ 66 | TRACE 67 | false 68 | pdbonly 69 | x86 70 | prompt 71 | MinimumRecommendedRules.ruleset 72 | true 73 | 74 | 75 | 534196170275135EB36684C88F3206175E455ADC 76 | 77 | 78 | DD监控室_TemporaryKey.pfx 79 | 80 | 81 | true 82 | 83 | 84 | true 85 | 86 | 87 | false 88 | 89 | 90 | 91 | Y:\DDTV\rst\1.0.1.5\IrisSkin4.dll 92 | 93 | 94 | False 95 | bin\x86\Release\MaterialSkin.dll 96 | 97 | 98 | False 99 | ..\..\..\..\..\..\Git_Non\东方网页项目\留言\bin\Newtonsoft.Json.dll 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | Form 121 | 122 | 123 | Form1.cs 124 | 125 | 126 | 127 | 128 | Form 129 | 130 | 131 | RecordForm.cs 132 | 133 | 134 | 135 | 136 | 137 | Form1.cs 138 | 139 | 140 | ResXFileCodeGenerator 141 | Resources.Designer.cs 142 | Designer 143 | 144 | 145 | True 146 | Resources.resx 147 | 148 | 149 | RecordForm.cs 150 | 151 | 152 | 153 | 154 | 155 | SettingsSingleFileGenerator 156 | Settings.Designer.cs 157 | 158 | 159 | True 160 | Settings.settings 161 | True 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | {6d7451c6-e747-4790-a32a-e394e062f090} 191 | DmWin 192 | 193 | 194 | {ef042ce7-004d-4271-aa32-8c51462f57d4} 195 | MPUCL 196 | 197 | 198 | 199 | 200 | False 201 | Microsoft .NET Framework 4.7.1 %28x86 和 x64%29 202 | true 203 | 204 | 205 | False 206 | .NET Framework 3.5 SP1 207 | false 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /DD监控室/DM_System/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | 弹幕测试 4 | Create By HBuilder 5 | 6 | 7 | 8 | 9 | com.aptana.ide.core.unifiedBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.aptana.projects.webnature 16 | 17 | 18 | 19 | 1552583162465 20 | 21 | 10 22 | 23 | org.eclipse.ui.ide.orFilterMatcher 24 | 25 | 26 | org.eclipse.ui.ide.multiFilter 27 | 1.0-projectRelativePath-matches-false-false-bin 28 | 29 | 30 | org.eclipse.ui.ide.multiFilter 31 | 1.0-projectRelativePath-matches-false-false-setting 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/css/style.css: -------------------------------------------------------------------------------- 1 | .abp { 2 | position: relative; 3 | height:100%;width:100%; 4 | } 5 | 6 | .abp .container { 7 | border: 0; 8 | bottom: 0; 9 | display: block; 10 | left: 0; 11 | margin: 0; 12 | overflow: hidden; 13 | position: absolute; 14 | right: 0; 15 | top: 0; 16 | touch-callout: none; 17 | -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 18 | transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 19 | -webkit-user-select: none; 20 | -moz-user-select: none; 21 | -ms-user-select: none; 22 | user-select: none; 23 | z-index: 9999; 24 | } 25 | 26 | 27 | 28 | .abp .container .cmt { 29 | 30 | color: #fff; 31 | font-family: SimHei, SimSun, Heiti, "MS Mincho", "Meiryo", "Microsoft YaHei", monospace; 32 | font-size: 25px; 33 | letter-spacing: 0; 34 | margin: 0; 35 | padding: 3px 0 0 0; 36 | position: absolute; 37 | text-decoration: none; 38 | text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; 39 | -webkit-text-size-adjust: none; 40 | -ms-text-size-adjust: none; 41 | text-size-adjust: none; 42 | -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 43 | transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 44 | -webkit-transform-origin: 0% 0%; 45 | -ms-transform-origin: 0% 0%; 46 | transform-origin: 0% 0%; 47 | white-space: pre; 48 | word-break: keep-all; 49 | } 50 | 51 | .abp .container .cmt.noshadow { 52 | text-shadow: none; 53 | } 54 | 55 | .abp .container .cmt.rshadow { 56 | text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white; 57 | } 58 | 59 | /** Aliases for Chinese named fonts because they don't work on *nix **/ 60 | @font-face{ 61 | font-family: '\9ED1\4F53'; 62 | src:local('SimHei'); 63 | } 64 | 65 | @font-face{ 66 | font-family: '\5B8B\4F53'; 67 | src:local('SimSun'); 68 | } 69 | 70 | @font-face{ 71 | font-family: '\534E\6587\6977\4F53'; 72 | src:local('SimKai'); 73 | } 74 | 75 | @font-face{ 76 | font-family: '\5E7C\5706'; 77 | src:local('YouYuan'); 78 | } 79 | 80 | @font-face{ 81 | font-family: '\5FAE\8F6F\96C5\9ED1'; 82 | src:local('Microsoft YaHei'); 83 | } 84 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/css/style.min.css: -------------------------------------------------------------------------------- 1 | .abp{position:relative}.abp .container{border:0;bottom:0;display:block;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0;touch-callout:none;-webkit-transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:9999}.abp .container .cmt{color:#fff;font-family:SimHei,SimSun,Heiti,"MS Mincho",Meiryo,"Microsoft YaHei",monospace;font-size:25px;letter-spacing:0;line-height:100%;margin:0;padding:3px 0 0 0;position:absolute;text-decoration:none;text-shadow:-1px 0 #000,0 1px #000,1px 0 #000,0 -1px #000;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);transform:matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;white-space:pre;word-break:keep-all}.abp .container .cmt.noshadow{text-shadow:none}.abp .container .cmt.rshadow{text-shadow:-1px 0 #fff,0 1px #fff,1px 0 #fff,0 -1px #fff}@font-face{font-family:'\9ED1\4F53';src:local('SimHei')}@font-face{font-family:'\5B8B\4F53';src:local('SimSun')}@font-face{font-family:'\534E\6587\6977\4F53';src:local('SimKai')}@font-face{font-family:'\5E7C\5706';src:local('YouYuan')}@font-face{font-family:'\5FAE\8F6F\96C5\9ED1';src:local('Microsoft YaHei')} -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/OOAPI.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Out-of-API Methods 3 | * @license MIT 4 | * @description This is the definition bridge for OOAPI methods. 5 | * Please always include it 6 | **/ 7 | var __OOAPI = new function () { 8 | var channels = {}; 9 | 10 | function dispatchMessage (msg) { 11 | if (channels.hasOwnProperty(msg.channel)) { 12 | for(var i = 0; i < channels[msg.channel].listeners.length; i++) { 13 | try { 14 | channels[msg.channel].listeners[i](msg.payload); 15 | } catch(e) { 16 | if (e.stack) { 17 | __trace(e.stack.toString(), 'err'); 18 | } else { 19 | __trace(e.toString(), 'err'); 20 | } 21 | } 22 | } 23 | } else { 24 | __trace('Got message on channel "' + msg.channel + 25 | '" but channel does not exist.', 'warn'); 26 | } 27 | }; 28 | 29 | self.addEventListener('message', function (event) { 30 | if (!event) { 31 | return; 32 | } 33 | try { 34 | var msg = JSON.parse(event.data); 35 | } catch (e) { 36 | __trace(e, 'err'); 37 | return; 38 | } 39 | if (msg !== null && msg.hasOwnProperty('channel') && 40 | typeof msg.channel === 'string') { 41 | dispatchMessage(msg); 42 | } else { 43 | __trace(msg, 'warn'); 44 | } 45 | }); 46 | 47 | this.listChannels = function () { 48 | var chl = {}; 49 | for (var chan in channels) { 50 | chl[chan] = { 51 | 'max': channels[chan].max, 52 | 'listeners': channels[chan].listeners.length 53 | }; 54 | } 55 | return chl; 56 | }; 57 | 58 | this.deleteChannel = function (channelId, authToken){ 59 | if (!(channelId in channels)) { 60 | return true; 61 | } 62 | if (authToken || channels[channelId].auth) { 63 | if (authToken === channels[channelId].auth) { 64 | delete channels[channelId]; 65 | return true; 66 | } 67 | return false; 68 | } else { 69 | delete channels[channelId]; 70 | return true; 71 | } 72 | }; 73 | 74 | this.createChannel = function (channelId, maximum, authToken) { 75 | if (!(channelId in channels)) { 76 | channels[channelId] = { 77 | 'max': maximum ? maximum : 0, 78 | 'auth': authToken, 79 | 'listeners': [] 80 | }; 81 | return true; 82 | } 83 | return false; 84 | }; 85 | 86 | this.addListenerChannel = function (channel, listener) { 87 | if (!(channel in channels)) { 88 | channels[channel] = { 89 | 'max': 0, 90 | 'listeners': [] 91 | }; 92 | } 93 | if (channels[channel].max > 0) { 94 | if (channels[channel].listeners.length >= 95 | channels[channel].max) { 96 | return false; 97 | } 98 | } 99 | channels[channel].listeners.push(listener); 100 | return true; 101 | }; 102 | }; 103 | 104 | function __trace (obj, traceMode) { 105 | self.postMessage(JSON.stringify({ 106 | 'channel': '', 107 | 'obj': obj, 108 | 'mode': (traceMode ? traceMode : 'log') 109 | })); 110 | }; 111 | 112 | function __channel (id, payload, callback) { 113 | self.postMessage(JSON.stringify({ 114 | 'channel': id, 115 | 'payload': payload, 116 | 'callback': true 117 | })); 118 | __OOAPI.addListenerChannel(id, callback); 119 | }; 120 | 121 | function __schannel (id, callback) { 122 | __OOAPI.addListenerChannel(id, callback); 123 | }; 124 | 125 | function __pchannel (id, payload) { 126 | self.postMessage(JSON.stringify({ 127 | 'channel': id, 128 | 'payload': payload, 129 | 'callback': false 130 | })); 131 | }; 132 | 133 | function __achannel (id, auth, payload) { 134 | self.postMessage(JSON.stringify({ 135 | 'channel': id, 136 | 'auth': auth, 137 | 'payload': payload, 138 | 'callback': false 139 | })); 140 | }; 141 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/Worker.js: -------------------------------------------------------------------------------- 1 | var __OOAPI; 2 | 3 | importScripts("OOAPI.js"); 4 | 5 | if (!__OOAPI) { 6 | console.log("Error: OOAPI Not Loaded"); 7 | self.close(); 8 | } 9 | 10 | // Hook independent channels that cannot be removed 11 | __OOAPI.createChannel("::eval", 1, Math.round(Math.random() * 100000)); 12 | __OOAPI.createChannel("::debug", 1, Math.round(Math.random() * 100000)); 13 | 14 | // Load the BSE Abstraction Runtime 15 | importScripts('api/Runtime.js', 16 | 'api/Player.js', 17 | 'api/Display.js', 18 | 'api/Tween.js', 19 | 'api/Utils.js', 20 | 'api/Global.js', 21 | 'api/Function.js'); 22 | 23 | // Immediately Hook into the eval channel, blocking future hooks 24 | __schannel("::eval", function (msg) { 25 | // Prevent some things from being accessed in eval easily 26 | (function (__code, importScripts, postMessage, addEventListener, self) { 27 | if (Tween && Tween.extendWithEasingFunctions) { 28 | Tween.extendWithEasingFunctions(this); 29 | } 30 | var clearTimeout = Utils.clearTimeout; 31 | var clearInterval = Utils.clearInterval; 32 | eval(__code); 33 | })(msg); 34 | }); 35 | 36 | __schannel("::debug", function (msg) { 37 | if (typeof msg === 'undefined' || msg === null || 38 | !msg.hasOwnProperty('action')) { 39 | __achannel('::worker:debug', 'worker', 'Malformed request'); 40 | return; 41 | } 42 | if (msg.action === 'list-channels') { 43 | __achannel('::worker:debug', 'worker', __OOAPI.listChannels()); 44 | } else if (msg.action === 'raw-eval') { 45 | try { 46 | __achannel('::worker:debug', 'worker', eval(msg.code)); 47 | } catch (e) { 48 | __achannel('::worker:debug', 'worker', 'Error: ' + e); 49 | } 50 | } else { 51 | __achannel('::worker:debug', 'worker', 'Unrecognized action'); 52 | } 53 | }); 54 | 55 | __achannel("::worker:state", "worker", "running"); 56 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/api/Function.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Global Functions 3 | * @description Functions defined in the global namespace. 4 | **/ 5 | 6 | function trace (msg) { 7 | if (typeof msg === 'object') { 8 | __trace(JSON.stringify(msg), 'log'); 9 | } else { 10 | __trace(msg, 'log'); 11 | } 12 | } 13 | 14 | function load (library, onComplete) { 15 | if (typeof Runtime === 'undefined' || Runtime === null) { 16 | __trace('No runtime defined. Attempting to raw-load library!', 'warn'); 17 | importScripts(library + '.js'); 18 | } else { 19 | // Delegate this to runtime 20 | Runtime.requestLibrary(library, function (error, response) { 21 | if (error) { 22 | __trace('Load: ' + error, 'warn'); 23 | } else { 24 | if (response.type === 'import') { 25 | importScripts(response.location); 26 | } else if (response.type === 'raw') { 27 | try { 28 | eval(response.code); 29 | } catch (e) { 30 | __trace('Load: ' + e, 'warn'); 31 | } 32 | } else if (response.type === 'object') { 33 | if (typeof self === 'object' && self !== null) { 34 | self[response.name] = response.obj; 35 | } 36 | } else if (response.type === 'noop') { 37 | // Don't do anything 38 | // This means library was already loaded 39 | } 40 | // Execute the remaining code 41 | if (typeof onComplete === 'function') { 42 | onComplete(); 43 | } 44 | } 45 | }); 46 | } 47 | } 48 | 49 | function clone (target) { 50 | if (null === target || 'object' !== typeof target) { 51 | return target; 52 | } 53 | 54 | // Clone an array 55 | if (Array.isArray(target)) { 56 | return target.slice(0); 57 | } 58 | 59 | // Call the object's own clone method if possible 60 | if (target.hasOwnProperty('clone') || typeof target['clone'] === 'function') { 61 | return target.clone(); 62 | } 63 | 64 | // Perform a shallow clone 65 | var copy = {}; 66 | copy.constructor = copy.constructor; 67 | copy.prototype = copy.prototype; 68 | for (var x in target) { 69 | copy[x] = target[x]; 70 | } 71 | return copy; 72 | } 73 | 74 | function foreach (enumerable, f) { 75 | if (null === enumerable || "object" !== typeof enumerable) { 76 | return; 77 | } 78 | // DisplayObjects do not have any enumerable properties 79 | if (enumerable instanceof Display.DisplayObject) { 80 | return; 81 | } 82 | 83 | for (var x in enumerable) { 84 | if (enumerable.hasOwnProperty(x)) { 85 | f(x, enumerable[x]); 86 | } 87 | } 88 | return; 89 | } 90 | 91 | var none = null; 92 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/api/Global.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Global Key-Value Store 3 | * @description Key-value store in the global namespace 4 | */ 5 | 6 | var Global = new function () { 7 | var _store = {}; 8 | 9 | this._set = function (key, val) { 10 | _store[key] = val; 11 | }; 12 | 13 | this._get = function (key) { 14 | return _store[key]; 15 | }; 16 | 17 | this._ = function (key) { 18 | return this._get(key); 19 | }; 20 | }; 21 | 22 | var $G = Global; 23 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/api/Player.js: -------------------------------------------------------------------------------- 1 | var CommentData = (function () { 2 | function CommentData(comment) { 3 | this._dbid = 0; 4 | this.blocked = false; 5 | this.blockType = 0; 6 | this.border = false; 7 | this.credit = false; 8 | this.date = ""; 9 | this.deleted = false; 10 | this.id = 0; 11 | this.mode = 0; 12 | this.msg = ""; 13 | this.live = true; 14 | this.locked = true; 15 | this.on = true; 16 | this.pool = 0; 17 | this.preview = false; 18 | this.reported = false; 19 | this.size = 25; 20 | this.stime = 0; 21 | this.text = ""; 22 | this.type = ""; 23 | this.uid = ""; 24 | this._dbid = comment["dbid"]; 25 | this.size = comment["size"]; 26 | this.text = comment["text"]; 27 | this.mode = comment["mode"]; 28 | this.stime = comment["stime"]; 29 | this.date = comment["date"]; 30 | } 31 | Object.defineProperty(CommentData.prototype, "danmuId", { 32 | get: function () { 33 | return this._dbid; 34 | }, 35 | enumerable: true, 36 | configurable: true 37 | }); 38 | return CommentData; 39 | }()); 40 | var Player; 41 | (function (Player) { 42 | var Sound = (function () { 43 | function Sound(type, onload) { 44 | this._isPlaying = false; 45 | this.onload = onload; 46 | this._source = type; 47 | } 48 | Sound.prototype.createFromURL = function (url) { 49 | this._source = url; 50 | }; 51 | Sound.prototype.play = function () { 52 | }; 53 | Sound.prototype.remove = function () { 54 | }; 55 | Sound.prototype.stop = function () { 56 | }; 57 | Sound.prototype.loadPercent = function () { 58 | return 0; 59 | }; 60 | Sound.prototype.serialize = function () { 61 | return { 62 | 'class': 'Sound', 63 | 'url': this._source 64 | }; 65 | }; 66 | return Sound; 67 | }()); 68 | })(Player || (Player = {})); 69 | var Player; 70 | (function (Player) { 71 | var _state = ''; 72 | var _time; 73 | var _commentList; 74 | var _refreshRate; 75 | var _width; 76 | var _height; 77 | var _videoWidth; 78 | var _videoHeight; 79 | var _lastUpdate = new Runtime.TimeKeeper(); 80 | Object.defineProperty(Player, 'state', { 81 | get: function () { return _state; }, 82 | set: function (value) { 83 | __trace('Player.state is read-only', 'warn'); 84 | } 85 | }); 86 | Object.defineProperty(Player, 'time', { 87 | get: function () { 88 | if (_state !== 'playing') { 89 | return _time; 90 | } 91 | else { 92 | return _time + _lastUpdate.elapsed; 93 | } 94 | }, 95 | set: function (value) { 96 | __trace('Player.time is read-only', 'warn'); 97 | } 98 | }); 99 | Object.defineProperty(Player, 'commentList', { 100 | get: function () { 101 | return _commentList; 102 | }, 103 | set: function (value) { 104 | __trace('Player.commentData is read-only', 'warn'); 105 | } 106 | }); 107 | Object.defineProperty(Player, 'refreshRate', { 108 | get: function () { 109 | return _refreshRate; 110 | }, 111 | set: function (value) { 112 | __trace("Player.refreshRate deprecated. Please use Display.frameRate", "warn"); 113 | } 114 | }); 115 | Object.defineProperty(Player, 'width', { 116 | get: function () { return _width; }, 117 | set: function (value) { 118 | __trace("Player.width is read-only", "warn"); 119 | } 120 | }); 121 | Object.defineProperty(Player, 'height', { 122 | get: function () { return _height; }, 123 | set: function (value) { 124 | __trace("Player.height is read-only", "warn"); 125 | } 126 | }); 127 | Object.defineProperty(Player, 'videoWidth', { 128 | get: function () { return _videoWidth; }, 129 | set: function (value) { 130 | __trace("Player.videoWidth is read-only", "warn"); 131 | } 132 | }); 133 | Object.defineProperty(Player, 'videoHeight', { 134 | get: function () { return _videoHeight; }, 135 | set: function (value) { 136 | __trace("Player.videoHeight is read-only", "warn"); 137 | } 138 | }); 139 | Object.defineProperty(Player, 'version', { 140 | get: function () { 141 | return 'CCLPlayer/1.0 HTML5/* (bilibili, like BSE, like flash)'; 142 | }, 143 | set: function (value) { 144 | __trace('Player.version is read-only', 'warn'); 145 | } 146 | }); 147 | function play() { 148 | __pchannel("Player::action", { 149 | "action": "play" 150 | }); 151 | } 152 | Player.play = play; 153 | function pause() { 154 | __pchannel("Player::action", { 155 | "action": "pause" 156 | }); 157 | } 158 | Player.pause = pause; 159 | function seek(offset) { 160 | __pchannel("Player::action", { 161 | "action": "seek", 162 | "params": offset 163 | }); 164 | } 165 | Player.seek = seek; 166 | function jump(video, page, newWindow) { 167 | if (page === void 0) { page = 1; } 168 | if (newWindow === void 0) { newWindow = false; } 169 | __pchannel("Player::action", { 170 | "action": "jump", 171 | "params": { 172 | "vid": video, 173 | "page": page, 174 | "window": newWindow 175 | } 176 | }); 177 | } 178 | Player.jump = jump; 179 | function commentTrigger(callback, timeout) { 180 | if (!Runtime.hasObject('__player')) { 181 | __trace('Your environment does not support player triggers.', 'warn'); 182 | return; 183 | } 184 | __trace('Comment trigger: not implemented', 'warn'); 185 | } 186 | Player.commentTrigger = commentTrigger; 187 | function keyTrigger(callback, timeout) { 188 | if (!Runtime.hasObject('__player')) { 189 | __trace('Your environment does not support key triggers.', 'warn'); 190 | return; 191 | } 192 | var player = Runtime.getObject('__player'); 193 | player.addEventListener('keydown', function (key) { 194 | callback(key.keyCode); 195 | }); 196 | } 197 | Player.keyTrigger = keyTrigger; 198 | function setMask(mask) { 199 | __trace('Masking not supported yet', 'warn'); 200 | } 201 | Player.setMask = setMask; 202 | function toString() { 203 | return '[player Player]'; 204 | } 205 | Player.toString = toString; 206 | __schannel('Update:DimensionUpdate', function (payload) { 207 | _width = payload["stageWidth"]; 208 | _height = payload["stageHeight"]; 209 | if (payload.hasOwnProperty("videoWidth") && 210 | payload.hasOwnProperty("videoHeight")) { 211 | _videoWidth = payload["videoWidth"]; 212 | _videoHeight = payload["videoHeight"]; 213 | } 214 | }); 215 | __schannel("Update:TimeUpdate", function (payload) { 216 | _state = payload["state"]; 217 | _time = payload["time"]; 218 | _lastUpdate.reset(); 219 | }); 220 | })(Player || (Player = {})); 221 | -------------------------------------------------------------------------------- /DD监控室/DM_System/dist/scripting/api/Utils.js: -------------------------------------------------------------------------------- 1 | var Utils; 2 | (function (Utils) { 3 | var _startTime = Date.now(); 4 | function HSV2RGB(hue, saturation, brightness) { 5 | var r, g, b; 6 | if (saturation == 0) { 7 | r = g = b = 1; 8 | } 9 | else { 10 | var h = (hue % 360) / 60; 11 | var i = h | 0; 12 | var f = h - i; 13 | var p = 1 - saturation; 14 | var q = 1 - saturation * f; 15 | var t = 1 - saturation * (1 - f); 16 | switch (i) { 17 | case 0: 18 | r = 1; 19 | g = t; 20 | b = p; 21 | break; 22 | case 1: 23 | r = q; 24 | g = 1; 25 | b = p; 26 | break; 27 | case 2: 28 | r = p; 29 | g = 1; 30 | b = t; 31 | break; 32 | case 3: 33 | r = p; 34 | g = q; 35 | b = 1; 36 | break; 37 | case 4: 38 | r = t; 39 | g = p; 40 | b = 1; 41 | break; 42 | case 5: 43 | r = 1; 44 | g = p; 45 | b = q; 46 | break; 47 | } 48 | } 49 | r *= 255 * brightness; 50 | g *= 255 * brightness; 51 | b *= 255 * brightness; 52 | return r << 16 | g << 8 | b; 53 | } 54 | function rgb(r, g, b) { 55 | return r << 16 | g << 8 | b; 56 | } 57 | Utils.rgb = rgb; 58 | function hue(h, s, v) { 59 | if (s === void 0) { s = 1; } 60 | if (v === void 0) { v = 1; } 61 | return HSV2RGB(h, s, v); 62 | } 63 | Utils.hue = hue; 64 | function formatTimes(time) { 65 | return Math.floor(time / 60) + ":" + (time % 60 > 9 ? "" : "0") + time % 60; 66 | } 67 | Utils.formatTimes = formatTimes; 68 | function distance(x1, y1, x2, y2) { 69 | return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); 70 | } 71 | Utils.distance = distance; 72 | function rand(min, max) { 73 | return min + Math.floor(Math.random() * (max - min)); 74 | } 75 | Utils.rand = rand; 76 | function getTimer() { 77 | return Date.now() - _startTime; 78 | } 79 | Utils.getTimer = getTimer; 80 | function timer(callback, delay) { 81 | if (delay === void 0) { delay = 1000; } 82 | return Runtime.getTimer().setTimeout(callback, delay); 83 | } 84 | Utils.timer = timer; 85 | function interval(callback, interval, repeatCount) { 86 | if (interval === void 0) { interval = 1000; } 87 | if (repeatCount === void 0) { repeatCount = 1; } 88 | if (repeatCount === 0) { 89 | return Runtime.getTimer().setInterval(callback, interval); 90 | } 91 | var ivl = Runtime.getTimer().setInterval(function () { 92 | repeatCount--; 93 | if (repeatCount < 0) { 94 | Runtime.getTimer().clearInterval(ivl); 95 | } 96 | else { 97 | callback(); 98 | } 99 | }, interval); 100 | return ivl; 101 | } 102 | Utils.interval = interval; 103 | function clearTimeout(tid) { 104 | Runtime.getTimer().clearTimeout(tid); 105 | } 106 | Utils.clearTimeout = clearTimeout; 107 | function clearInterval(iid) { 108 | Runtime.getTimer().clearInterval(iid); 109 | } 110 | Utils.clearInterval = clearInterval; 111 | })(Utils || (Utils = {})); 112 | var getTimer = Utils.getTimer; 113 | var interval = Utils.interval; 114 | var timer = Utils.timer; 115 | -------------------------------------------------------------------------------- /DD监控室/DM_System/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This is a Sample of the Library 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 | 16 |
17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /DD监控室/DM_System/main.js: -------------------------------------------------------------------------------- 1 | function $(element) { 2 | // 获取 DOM 对象的短写,如果你在用 jQuery 也可以采用类似的方法 3 | return document.getElementById(element); 4 | }; 5 | 6 | window.addEventListener('load', function () { 7 | // 在窗体载入完毕后再绑定 8 | var CM = new CommentManager($('my-comment-stage')); 9 | CM.init(); 10 | 11 | // 先启用弹幕播放(之后可以停止) 12 | CM.start(); 13 | CM.options.global.scale=3; 14 | // 绑定按钮们 15 | document.body.style.overflow = 'hidden'; 16 | var t1 = window.setInterval(callback,100); 17 | 18 | 19 | var startTime = 0, iVal = -1; 20 | $('btnTimer').addEventListener('click', function (e) { 21 | e.preventDefault(); // 抑制默认操作 22 | startTime = Date.now(); // 设定起始时间 23 | if (iVal >= 0) { 24 | clearInterval(iVal); // 如果之前就有定时器,把它停掉 25 | } 26 | //建立新的定时器 27 | iVal = setInterval(function () { 28 | var playTime = Date.now() - startTime; // 用起始时间和现在时间的差模拟播放 29 | CM.time(playTime); // 通报播放时间 30 | $('txPlayPos').textContent = playTime; // 显示播放时间 31 | }, 100); // 模拟播放器每 100ms 通报播放时间 32 | }); 33 | 34 | // 开放 CM 对象到全局这样就可以在 console 终端里操控 35 | window.CM = CM; 36 | }); 37 | 38 | function callback() { 39 | 40 | // var J_NavContent=document.getElementById("DMK"); 41 | 42 | // var w=document.body.clientWidth; 43 | // var h=document.body.clientHeight; 44 | // J_NavContent.style.width=w+"px"; 45 | // J_NavContent.style.height=h+"px"; 46 | //alert(div.style.width+":"+div.style.height); 47 | boud.ShowTest();; 48 | if(boud.js!="0") 49 | var danmaku2 = { 50 | "mode": 1, 51 | "text": "                                             "+boud.js, 52 | "stime": 100000, 53 | "size": 25, 54 | "color": 0xffffff 55 | }; 56 | 57 | CM.send(danmaku2); 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /DD监控室/DM_System/my-page-styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin:0px; 3 | padding:0px; 4 | font-family: "Segoe UI", "Microsoft Yahei", sans-serif; 5 | } 6 | 7 | .controlbox { 8 | padding:30px; 9 | } 10 | -------------------------------------------------------------------------------- /DD监控室/MMPU.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.NetworkInformation; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using static System.Net.Mime.MediaTypeNames; 11 | 12 | namespace DD监控室 13 | { 14 | public class MMPU 15 | { 16 | private static string RoomConfigFile = "./RoomListConfig.ini"; 17 | public static List DMlist = new List(); 18 | public static int DmNum = 0; 19 | public class danmu 20 | { 21 | public int mode { get; set; }//模式 22 | public string text { get; set; }//内容 23 | public int stime { get; set; }//时间 24 | public int size { get; set; }//大小 25 | public string color { get; set; }//颜色 26 | } 27 | /// 28 | /// 获取房间的弹幕 29 | /// 30 | /// 房间号 31 | /// 32 | public static string getbalabala(string room) 33 | { 34 | string postString = "roomid=" + room + "&token=&csrf_token="; 35 | byte[] postData = Encoding.UTF8.GetBytes(postString); 36 | string url = @"http://api.live.bilibili.com/ajax/msg"; 37 | 38 | WebClient webClient = new WebClient(); 39 | webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"); 40 | webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); 41 | webClient.Headers.Add("Cookie", ""); 42 | byte[] responseData = webClient.UploadData(url, "POST", postData); 43 | string srcString = Encoding.UTF8.GetString(responseData);//解码 44 | return srcString; 45 | } 46 | 47 | /// 48 | /// 用于检查IP地址或域名是否可以使用TCP/IP协议访问(使用Ping命令),true表示Ping成功,false表示Ping失败 49 | /// 50 | /// 域名或IP 51 | /// 52 | public static bool 测试网络(string A) 53 | { 54 | try 55 | { 56 | Ping objPingSender = new Ping(); 57 | PingOptions objPinOptions = new PingOptions(); 58 | objPinOptions.DontFragment = true; 59 | string data = ""; 60 | byte[] buffer = Encoding.UTF8.GetBytes(data); 61 | int intTimeout = 120; 62 | PingReply objPinReply = objPingSender.Send(A, intTimeout, buffer, objPinOptions); 63 | string strInfo = objPinReply.Status.ToString(); 64 | if (strInfo == "Success") 65 | { 66 | return true; 67 | } 68 | else 69 | { 70 | objPinReply = objPingSender.Send("223.6.6.6", intTimeout, buffer, objPinOptions); 71 | strInfo = objPinReply.Status.ToString(); 72 | if (strInfo == "Success") 73 | { 74 | return true; 75 | } 76 | else 77 | { 78 | return false; 79 | } 80 | 81 | } 82 | } 83 | catch (Exception ex) 84 | { 85 | return false; 86 | } 87 | } 88 | /// 89 | /// 储存文件 90 | /// 91 | /// 文件完整路径 92 | /// 储存的文本内容 93 | public static void SaveFile(string file, string str) 94 | { 95 | FileStream fs = new FileStream(file, FileMode.Create); 96 | byte[] data = Encoding.UTF8.GetBytes(str); 97 | fs.Write(data, 0, data.Length); 98 | fs.Flush(); 99 | fs.Close(); 100 | } 101 | public static void InitializeRoomConfigFile() 102 | { 103 | try 104 | { 105 | ReadFile(RoomConfigFile); 106 | } 107 | catch (Exception) 108 | { 109 | 110 | SaveFile(RoomConfigFile, "{}"); 111 | } 112 | } 113 | /// 114 | /// 读取文件 115 | /// 116 | /// 文件完整路径 117 | /// 118 | public static string ReadFile(string file) 119 | { 120 | string str; 121 | StreamReader sr = new StreamReader(file, true); 122 | str = sr.ReadLine().ToString(); 123 | sr.Close(); 124 | return str; 125 | } 126 | /// 127 | /// 通过get方式返回内容 128 | /// 129 | /// 目标网页地址 130 | /// 131 | public static string get返回网页内容(string url) 132 | { 133 | string result = ""; 134 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); 135 | req.Method = "GET"; 136 | req.ContentType = "application/x-www-form-urlencoded"; 137 | 138 | HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); 139 | Stream stream = resp.GetResponseStream(); 140 | //获取响应内容 141 | using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) 142 | { 143 | result = reader.ReadToEnd(); 144 | } 145 | return result; 146 | } 147 | public static string HttpDownloadFile(string url, string path) 148 | { 149 | try 150 | { 151 | // 设置参数 152 | HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; 153 | //发送请求并获取相应回应数据 154 | HttpWebResponse response = request.GetResponse() as HttpWebResponse; 155 | //直到request.GetResponse()程序才开始向目标网页发送Post请求 156 | Stream responseStream = response.GetResponseStream(); 157 | //创建本地文件写入流 158 | Stream stream = new FileStream(path, FileMode.Create); 159 | byte[] bArr = new byte[1024]; 160 | int size = responseStream.Read(bArr, 0, (int)bArr.Length); 161 | while (size > 0) 162 | { 163 | stream.Write(bArr, 0, size); 164 | size = responseStream.Read(bArr, 0, (int)bArr.Length); 165 | } 166 | stream.Close(); 167 | responseStream.Close(); 168 | } 169 | catch (Exception) 170 | { 171 | } 172 | return path; 173 | } 174 | /// 175 | /// 检测指定文件是否存在,如果存在则返回true。 176 | /// 177 | /// 文件的绝对路径 178 | public static bool IsExistFile(string filePath) 179 | { 180 | return File.Exists(filePath); 181 | } 182 | /// 183 | /// 检测指定目录是否存在 184 | /// 185 | /// 目录的绝对路径 186 | /// 187 | public static void IsExistDirectory(string directoryPath) 188 | { 189 | if (false == System.IO.Directory.Exists(directoryPath)) 190 | { 191 | //创建pic文件夹 192 | System.IO.Directory.CreateDirectory(directoryPath); 193 | } 194 | } 195 | /// 196 | /// 删除目录 197 | /// 198 | /// 199 | public static void DelectDir(string srcPath) 200 | { 201 | try 202 | { 203 | DirectoryInfo dir = new DirectoryInfo(srcPath); 204 | FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //返回目录中所有文件和子目录 205 | foreach (FileSystemInfo i in fileinfo) 206 | { 207 | if (i is DirectoryInfo) //判断是否文件夹 208 | { 209 | DirectoryInfo subdir = new DirectoryInfo(i.FullName); 210 | subdir.Delete(true); //删除子目录和文件 211 | } 212 | else 213 | { 214 | //如果 使用了 streamreader 在删除前 必须先关闭流 ,否则无法删除 sr.close(); 215 | File.Delete(i.FullName); //删除指定文件 216 | } 217 | } 218 | } 219 | catch (Exception e) 220 | { 221 | } 222 | } 223 | public static void DelFile(string Path) 224 | { 225 | File.Delete(Path); 226 | } 227 | } 228 | } 229 | -------------------------------------------------------------------------------- /DD监控室/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace DD监控室 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | //Application.Run(new Main()); 20 | Application.Run(new Main()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DD监控室/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DDTV")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DDTV")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("60faab44-24a1-48b7-b728-ce257e4c9de5")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1.8")] 36 | [assembly: AssemblyFileVersion("1.0.1.8")] 37 | -------------------------------------------------------------------------------- /DD监控室/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DD监控室.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DD监控室.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DD监控室/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /DD监控室/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace DD监控室.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DD监控室/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DD监控室/RecordForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace DD监控室 2 | { 3 | partial class RecordForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RecordForm)); 33 | this.listView1 = new System.Windows.Forms.ListView(); 34 | this.imageList1 = new System.Windows.Forms.ImageList(this.components); 35 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 36 | this.label2 = new System.Windows.Forms.Label(); 37 | this.label1 = new System.Windows.Forms.Label(); 38 | this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); 39 | this.groupBox1.SuspendLayout(); 40 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); 41 | this.SuspendLayout(); 42 | // 43 | // listView1 44 | // 45 | this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 46 | | System.Windows.Forms.AnchorStyles.Left) 47 | | System.Windows.Forms.AnchorStyles.Right))); 48 | this.listView1.GridLines = true; 49 | this.listView1.Location = new System.Drawing.Point(6, 20); 50 | this.listView1.Name = "listView1"; 51 | this.listView1.Size = new System.Drawing.Size(1013, 152); 52 | this.listView1.TabIndex = 0; 53 | this.listView1.UseCompatibleStateImageBehavior = false; 54 | this.listView1.View = System.Windows.Forms.View.Details; 55 | // 56 | // imageList1 57 | // 58 | this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); 59 | this.imageList1.TransparentColor = System.Drawing.Color.Transparent; 60 | this.imageList1.Images.SetKeyName(0, "OK.png"); 61 | this.imageList1.Images.SetKeyName(1, "REC.png"); 62 | // 63 | // groupBox1 64 | // 65 | this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 66 | | System.Windows.Forms.AnchorStyles.Left) 67 | | System.Windows.Forms.AnchorStyles.Right))); 68 | this.groupBox1.Controls.Add(this.label2); 69 | this.groupBox1.Controls.Add(this.listView1); 70 | this.groupBox1.Controls.Add(this.label1); 71 | this.groupBox1.Location = new System.Drawing.Point(12, 12); 72 | this.groupBox1.Name = "groupBox1"; 73 | this.groupBox1.Size = new System.Drawing.Size(1025, 178); 74 | this.groupBox1.TabIndex = 1; 75 | this.groupBox1.TabStop = false; 76 | this.groupBox1.Text = "录制情况"; 77 | // 78 | // label2 79 | // 80 | this.label2.AutoSize = true; 81 | this.label2.Location = new System.Drawing.Point(302, 0); 82 | this.label2.Name = "label2"; 83 | this.label2.Size = new System.Drawing.Size(455, 12); 84 | this.label2.TabIndex = 3; 85 | this.label2.Text = "(检测后设定为2,过多可能会触发一些奇怪的服务器保护机制导致无限重连下载失败)"; 86 | // 87 | // label1 88 | // 89 | this.label1.AutoSize = true; 90 | this.label1.Location = new System.Drawing.Point(130, 0); 91 | this.label1.Name = "label1"; 92 | this.label1.Size = new System.Drawing.Size(107, 12); 93 | this.label1.TabIndex = 2; 94 | this.label1.Text = "同时进行的进程数:"; 95 | // 96 | // numericUpDown1 97 | // 98 | this.numericUpDown1.Enabled = false; 99 | this.numericUpDown1.Location = new System.Drawing.Point(261, 7); 100 | this.numericUpDown1.Maximum = new decimal(new int[] { 101 | 10, 102 | 0, 103 | 0, 104 | 0}); 105 | this.numericUpDown1.Name = "numericUpDown1"; 106 | this.numericUpDown1.Size = new System.Drawing.Size(47, 21); 107 | this.numericUpDown1.TabIndex = 1; 108 | this.numericUpDown1.Value = new decimal(new int[] { 109 | 2, 110 | 0, 111 | 0, 112 | 0}); 113 | this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged); 114 | // 115 | // RecordForm 116 | // 117 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 118 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 119 | this.ClientSize = new System.Drawing.Size(1049, 202); 120 | this.Controls.Add(this.numericUpDown1); 121 | this.Controls.Add(this.groupBox1); 122 | this.Name = "RecordForm"; 123 | this.Text = "录制情况(如果出现不断重连下载的情况,说明硬件或者网络性能不够了...少开点)"; 124 | this.Load += new System.EventHandler(this.RecordForm_Load); 125 | this.groupBox1.ResumeLayout(false); 126 | this.groupBox1.PerformLayout(); 127 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); 128 | this.ResumeLayout(false); 129 | 130 | } 131 | 132 | #endregion 133 | 134 | private System.Windows.Forms.ListView listView1; 135 | private System.Windows.Forms.ImageList imageList1; 136 | private System.Windows.Forms.GroupBox groupBox1; 137 | private System.Windows.Forms.NumericUpDown numericUpDown1; 138 | private System.Windows.Forms.Label label1; 139 | private System.Windows.Forms.Label label2; 140 | } 141 | } -------------------------------------------------------------------------------- /DD监控室/RecordForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using MPUCL; 11 | using System.Threading; 12 | 13 | namespace DD监控室 14 | { 15 | public partial class RecordForm : Form 16 | { 17 | public RecordForm() 18 | { 19 | InitializeComponent(); 20 | numericUpDown1.Value = MMPU.RecMax; 21 | } 22 | 23 | private void RecordForm_Load(object sender, EventArgs e) 24 | { 25 | this.listView1.SmallImageList = this.imageList1; //0是完成,1是录制中 26 | this.listView1.Columns.Add("房间号", 90, HorizontalAlignment.Center); 27 | this.listView1.Columns.Add("状态", 60, HorizontalAlignment.Center); 28 | this.listView1.Columns.Add("文件地址", 250, HorizontalAlignment.Left); 29 | this.listView1.Columns.Add("开始时间", 150, HorizontalAlignment.Center); 30 | this.listView1.Columns.Add("结束时间", 150, HorizontalAlignment.Center); 31 | 32 | Thread T1 = new Thread(new ThreadStart(delegate { 33 | while (true) 34 | { 35 | this.listView1.BeginUpdate(); //数据更新,UI暂时挂起,直到EndUpdate绘制控件,可以有效避免闪烁并大大提高加载速度 36 | listView1.Items.Clear(); 37 | 38 | 39 | for (int i = 0; i < MMPU.RecordInfo.Count; i++) 40 | { 41 | ListViewItem lvi = new ListViewItem(); 42 | lvi.ImageIndex = (MMPU.RecordInfo[i].Status ? 1 : 0); //通过与imageList绑定,显示imageList中第i项图标 43 | lvi.Text = MMPU.RecordInfo[i].RoomID; 44 | lvi.SubItems.Add(MMPU.RecordInfo[i].Status ? "录制中" : "录制结束"); 45 | lvi.SubItems.Add(MMPU.RecordInfo[i].File); 46 | lvi.SubItems.Add(MMPU.RecordInfo[i].StartTime); 47 | lvi.SubItems.Add(MMPU.RecordInfo[i].EndTime); 48 | this.listView1.Items.Add(lvi); 49 | } 50 | this.listView1.EndUpdate(); //结束数据处理,UI界面一次性绘制。 51 | Thread.Sleep(3000); 52 | } 53 | })); 54 | T1.IsBackground = true; 55 | T1.Start(); 56 | } 57 | bool ACS = true; 58 | private void numericUpDown1_ValueChanged(object sender, EventArgs e) 59 | { 60 | if(ACS) 61 | { 62 | if((int)numericUpDown1.Value>=3) 63 | { 64 | ACS=false; 65 | MessageBox.Show("过多的线程可能导致无限重复连接,如果出现无限重复,请重启软件"); 66 | } 67 | } 68 | MMPU.RecMax = (int)numericUpDown1.Value; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DD监控室/RecordForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 125 | AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w 126 | LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 127 | ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADc 128 | CAAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo 129 | AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA 130 | AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 131 | AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA 132 | AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm 133 | AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM 134 | AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA 135 | ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz 136 | AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ 137 | AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM 138 | AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA 139 | AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA 140 | AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ 141 | AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ 142 | AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA 143 | AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm 144 | ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ 145 | Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz 146 | AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA 147 | AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM 148 | AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM 149 | ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM 150 | Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA 151 | AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM 152 | AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ 153 | AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz 154 | AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm 155 | AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw 156 | AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wUAAfQBwQF8AjwBfAHB 157 | AfQIAAHzAZIBFAIOARQBkgHzJgAB/wGeAXsGPAF7AZ4B/wQAAf8BkggAAZIB/yMAAf8BwAo8AcAB/wIA 158 | Af8BbQMABAsDAAFtAf8iAAGeDDwBngIAAZICAAELAR8E+QEfAQsCAAGSIQAB9AF7DDwBewH0AfMCAAEL 159 | ASAG+QEgAQsCAAHzIAABwQ48AcEBkgIAAR8I+QEfAgABkiAAAXwOPAF8ARQBAAELCvkBCwEAARQgAAF7 160 | DjwBewEOAQABCwr5AQsBAAEOIAABew48AXsBDgEAAQsK+QELAQABDiAAAXwOPAF8ARQBAAELCvkBCwEA 161 | ARQgAAHBDjwBwQGSAgABHwj5AR8CAAGSIAAB9AF7DDwBewH0AfMCAAELASAG+QEgAQsCAAHzIQABngw8 162 | AZ4CAAGSAgABCwEfBPkBHwELAgABkiIAAf8BwAo8AcAB/wIAAf8BbQMABAsDAAFtAf8jAAH/AZ4BewY8 163 | AXsBngH/BAAB/wGSCAABkgH/JgAB9AHBAXwCPAF8AcEB9AgAAfMBkgEUAg4BFAGSAfMkAAFCAU0BPgcA 164 | AT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAB8AEPAfABDwQAAcABAwHAAQMEAAGAAQEBgAEB 165 | BAABgAEBAYABAUQAAYABAQGAAQEEAAGAAQEBgAEBBAABwAEDAcABAwQAAfABDwHwAQ8EAAs= 166 | 167 | 168 | -------------------------------------------------------------------------------- /DD监控室/Room.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DD监控室 8 | { 9 | class Room 10 | { 11 | public class RoomBox 12 | { 13 | public List data { get; set; } 14 | } 15 | 16 | public class RoomCadr 17 | { 18 | public string Name { get; set; } 19 | public string RoomNumber { get; set; } 20 | public string Types { get; set; } 21 | public bool status { get; set; } 22 | public bool VideoStatus { get; set; } 23 | } 24 | 25 | /// 26 | /// 房间的动态数据 27 | /// 28 | public class RoomInfo 29 | { 30 | public string Name { get; set; } 31 | public string RoomNumber { get; set; } 32 | public string Text { get; set; } 33 | public string steam { get; set; } 34 | public bool status { get; set; } 35 | public bool Top { get; set; } 36 | 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DD监控室/RoomListConfig.ini: -------------------------------------------------------------------------------- 1 | {"data":[{"Name":"京哥哥_Overidea","RoomNumber":"704808","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"角龙","RoomNumber":"3822389","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"大根子","RoomNumber":"4664126","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"小雪","RoomNumber":"6241497","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"Hiyoko","RoomNumber":"3657657","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"赤井心","RoomNumber":"14275133","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"阿夸","RoomNumber":"14917277","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"千草はな","RoomNumber":"12770821","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"犬山哥","RoomNumber":"4634167","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"爱小姐","RoomNumber":"12235923","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"小狐狸","RoomNumber":"11588230","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"mugi","RoomNumber":"11261960","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"24小时","RoomNumber":"43822","Types":"bilibili","status":true,"VideoStatus":true},{"Name":"百鬼","RoomNumber":"21130785","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"大神澪","RoomNumber":"21133979","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"夏哥","RoomNumber":"13946381","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"狗妈","RoomNumber":"21304638","Types":"bilibili","status":false,"VideoStatus":true},{"Name":"宇森ひなこ","RoomNumber":"11672349","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"魔宵","RoomNumber":"1321846","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"紫咲诗音","RoomNumber":"21132965","Types":"bilibili","status":false,"VideoStatus":false},{"Name":"www","RoomNumber":"2440788","Types":"bilibili","status":false,"VideoStatus":true}]} -------------------------------------------------------------------------------- /DD监控室/VLCAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Security; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Runtime.ExceptionServices; 9 | 10 | namespace DD监控室 11 | { 12 | internal class VLCAPI 13 | { 14 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 15 | [SuppressUnmanagedCodeSecurity] 16 | public static extern IntPtr libvlc_new(int argc, IntPtr argv); 17 | 18 | // 释放libvlc实例 19 | 20 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 21 | [SuppressUnmanagedCodeSecurity] 22 | public static extern void libvlc_release(IntPtr libvlc_instance); 23 | 24 | 25 | 26 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 27 | [SuppressUnmanagedCodeSecurity] 28 | public static extern String libvlc_get_version(); 29 | 30 | 31 | 32 | // 从视频来源(例如Url)构建一个libvlc_meida RTSP 33 | 34 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 35 | [SuppressUnmanagedCodeSecurity] 36 | public static extern IntPtr libvlc_media_new_location(IntPtr libvlc_instance, IntPtr path); 37 | 38 | 39 | 40 | // 从本地文件路径构建一个libvlc_media rtsp串流不适合调用此接口 41 | // [MarshalAs(UnmanagedType.LPStr)] string path 42 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 43 | [SuppressUnmanagedCodeSecurity] 44 | public static extern IntPtr libvlc_media_new_path(IntPtr libvlc_instance, IntPtr path); 45 | 46 | /// 47 | /// 影片长度 48 | /// 49 | /// 50 | /// 51 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 52 | [SuppressUnmanagedCodeSecurity] 53 | public static extern IntPtr libvlc_media_player_get_length(IntPtr libvlc_media_player); 54 | 55 | 56 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 57 | [SuppressUnmanagedCodeSecurity] 58 | public static extern void libvlc_media_release(IntPtr libvlc_media_inst); 59 | 60 | 61 | 62 | // 创建libvlc_media_player(播放核心) 63 | 64 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 65 | [SuppressUnmanagedCodeSecurity] 66 | public static extern IntPtr libvlc_media_player_new(IntPtr libvlc_instance); 67 | 68 | 69 | 70 | // 将视频(libvlc_media)绑定到播放器上 71 | 72 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 73 | [SuppressUnmanagedCodeSecurity] 74 | public static extern void libvlc_media_player_set_media(IntPtr libvlc_media_player, IntPtr libvlc_media); 75 | 76 | 77 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 78 | [SuppressUnmanagedCodeSecurity] 79 | public static extern void libvlc_media_player_new_from_media(IntPtr libvlc_media_player); 80 | 81 | // 设置图像输出的窗口 82 | 83 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 84 | [SuppressUnmanagedCodeSecurity] 85 | public static extern void libvlc_media_player_set_hwnd(IntPtr libvlc_mediaplayer, Int32 drawable); 86 | 87 | 88 | 89 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 90 | [SuppressUnmanagedCodeSecurity] 91 | public static extern void libvlc_media_player_play(IntPtr libvlc_mediaplayer); 92 | 93 | 94 | 95 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 96 | [SuppressUnmanagedCodeSecurity] 97 | public static extern void libvlc_media_player_pause(IntPtr libvlc_mediaplayer); 98 | 99 | 100 | 101 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 102 | [SuppressUnmanagedCodeSecurity] 103 | public static extern void libvlc_media_player_stop(IntPtr libvlc_mediaplayer); 104 | 105 | //获取播放状态 106 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 107 | [SuppressUnmanagedCodeSecurity] 108 | 109 | public static extern int libvlc_media_player_get_state(IntPtr libvlc_mediaplayer); 110 | 111 | 112 | // 解析视频资源的媒体信息(如时长等) 113 | 114 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 115 | [SuppressUnmanagedCodeSecurity] 116 | public static extern void libvlc_media_parse(IntPtr libvlc_media); 117 | 118 | 119 | 120 | // 返回视频的时长(必须先调用libvlc_media_parse之后,该函数才会生效) 121 | 122 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 123 | [SuppressUnmanagedCodeSecurity] 124 | public static extern Int64 libvlc_media_get_duration(IntPtr libvlc_media); 125 | 126 | 127 | 128 | // 当前播放的时间 129 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 130 | [SuppressUnmanagedCodeSecurity] 131 | public static extern Int64 libvlc_media_player_get_time(IntPtr libvlc_mediaplayer); 132 | 133 | 134 | 135 | // 设置播放位置(拖动) 136 | 137 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 138 | [SuppressUnmanagedCodeSecurity] 139 | public static extern void libvlc_media_player_set_time(IntPtr libvlc_mediaplayer, Int64 time); 140 | 141 | /// 142 | /// 抓图 143 | /// 144 | /// 145 | /// 经典0 146 | /// 完整路径,文件名英文或下划线开头 147 | /// 148 | /// 149 | /// 150 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 151 | [SuppressUnmanagedCodeSecurity] 152 | public static extern int libvlc_video_take_snapshot(IntPtr libvlc_mediaplayer, uint num, IntPtr filePath, uint i_width, uint i_height); 153 | 154 | 155 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 156 | [SuppressUnmanagedCodeSecurity] 157 | public static extern void libvlc_media_player_release(IntPtr libvlc_mediaplayer); 158 | 159 | 160 | 161 | // 获取和设置音量 162 | 163 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 164 | [SuppressUnmanagedCodeSecurity] 165 | public static extern int libvlc_audio_get_volume(IntPtr libvlc_media_player); 166 | 167 | 168 | 169 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 170 | [SuppressUnmanagedCodeSecurity] 171 | public static extern void libvlc_audio_set_volume(IntPtr libvlc_media_player, int volume); 172 | 173 | 174 | 175 | // 设置全屏 176 | 177 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 178 | [SuppressUnmanagedCodeSecurity] 179 | public static extern void libvlc_set_fullscreen(IntPtr libvlc_media_player, int isFullScreen); 180 | 181 | [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 182 | [SuppressUnmanagedCodeSecurity] 183 | public static extern int libvlc_get_fullscreen(IntPtr libvlc_media_player); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /DD监控室/VLCPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Runtime.InteropServices; 7 | using System.Threading; 8 | using System.Runtime.ExceptionServices; 9 | using System.Security; 10 | 11 | namespace DD监控室 12 | { 13 | public class VLCPlayer : IDisposable 14 | { 15 | // Properties 16 | 17 | private IntPtr libvlc_instance_; 18 | private IntPtr libvlc_media_player_; 19 | 20 | private bool HasInstance => (libvlc_instance_ != IntPtr.Zero); 21 | private bool HasPlayer => HasInstance && (libvlc_media_player_ != IntPtr.Zero); 22 | 23 | public string Version => VLCAPI.libvlc_get_version(); 24 | public bool IsInitlized => HasPlayer; 25 | 26 | public double PlayTime 27 | { 28 | get => VLCAPI.libvlc_media_player_get_time(libvlc_media_player_) / 1000.0; 29 | set => VLCAPI.libvlc_media_player_set_time(libvlc_media_player_, (Int64)(value * 1000)); 30 | } 31 | public int Volume 32 | { 33 | get => VLCAPI.libvlc_audio_get_volume(libvlc_media_player_); 34 | set => VLCAPI.libvlc_audio_set_volume(libvlc_media_player_, value); 35 | } 36 | public bool Fullscreen 37 | { 38 | get => VLCAPI.libvlc_get_fullscreen(libvlc_media_player_) == 1; 39 | set => VLCAPI.libvlc_set_fullscreen(libvlc_media_player_, value ? 1 : 0); 40 | } 41 | 42 | // Methods 43 | 44 | public VLCPlayer() 45 | { 46 | 47 | //string plugin_arg = "--plugin-path=" + System.Environment.CurrentDirectory + "\\plugins\\"; 48 | //"--network-caching=300"减少网络延迟300秒 49 | // "--no-snapshot-preview" 50 | //"-I", "dummy", "--ignore-config", "--extraintf=logger", 51 | string[] args = { "--verbose=2", "--network-caching=300", "--no-snapshot-preview" }; 52 | 53 | byte[][] argvbytes = new byte[args.Length][]; 54 | 55 | for (int i = 0; i < args.Length; i++) 56 | { 57 | argvbytes[i] = Encoding.UTF8.GetBytes(args[i]); 58 | } 59 | 60 | libvlc_instance_ = VLCAPI.libvlc_new(args.Length, VLCUtil.ReturnIntPtr(argvbytes, args.Length)); 61 | 62 | if (HasInstance) 63 | libvlc_media_player_ = VLCAPI.libvlc_media_player_new(libvlc_instance_); 64 | 65 | if (!HasPlayer) 66 | Dispose(); 67 | } 68 | 69 | public void Dispose() 70 | { 71 | Dispose(true); 72 | GC.SuppressFinalize(this); 73 | } 74 | 75 | protected virtual void Dispose(bool disposing) 76 | { 77 | if (HasPlayer) 78 | { 79 | Stop(); // Stop (no effect if there is no media) 80 | 81 | VLCAPI.libvlc_media_player_release(libvlc_media_player_); 82 | libvlc_media_player_ = IntPtr.Zero; 83 | } 84 | 85 | if (HasInstance) 86 | { 87 | VLCAPI.libvlc_release(libvlc_instance_); 88 | libvlc_instance_ = IntPtr.Zero; 89 | } 90 | } 91 | 92 | [HandleProcessCorruptedStateExceptions] 93 | public int GetPlayerState() 94 | { 95 | try 96 | { 97 | return VLCAPI.libvlc_media_player_get_state(libvlc_media_player_); 98 | } 99 | catch (Exception) 100 | { 101 | return -10; 102 | } 103 | 104 | } 105 | 106 | private int SetRenderWindow(int wndHandle) 107 | { 108 | if (wndHandle != 0) 109 | { 110 | if(IsInitlized) 111 | { 112 | VLCAPI.libvlc_media_player_set_hwnd(libvlc_media_player_, wndHandle); 113 | return 0; 114 | } 115 | else 116 | { 117 | return -1; 118 | } 119 | 120 | } 121 | else 122 | { 123 | return -1; 124 | } 125 | } 126 | 127 | #region Media Resource 128 | 129 | private void LoadMediaFromUrl(string path) 130 | { 131 | IntPtr pathPtr = VLCUtil.StringToPtr(path); 132 | IntPtr md = VLCAPI.libvlc_media_new_location(libvlc_instance_, pathPtr); 133 | Marshal.FreeHGlobal(pathPtr); 134 | 135 | SetMedia(md); 136 | } 137 | 138 | private void LoadMediaFromFile(string path) 139 | { 140 | IntPtr pathPtr = VLCUtil.StringToPtr(path); 141 | IntPtr md = VLCAPI.libvlc_media_new_path(libvlc_instance_, pathPtr); 142 | Marshal.FreeHGlobal(pathPtr); 143 | 144 | SetMedia(md); 145 | } 146 | 147 | private void SetMedia(IntPtr media) 148 | { 149 | if (media != IntPtr.Zero) 150 | { 151 | VLCAPI.libvlc_media_player_set_media(libvlc_media_player_, media); // If any, previous media will be released. 152 | VLCAPI.libvlc_media_release(media); 153 | } 154 | } 155 | 156 | #endregion // Media Resource 157 | 158 | #region Play Control 159 | 160 | public void Play(string filePath, IntPtr handle) 161 | { 162 | if(SetRenderWindow((int)handle)!=-1) 163 | { 164 | LoadMediaFromUrl(filePath); 165 | 166 | VLCAPI.libvlc_media_player_play(libvlc_media_player_); 167 | } 168 | 169 | } 170 | 171 | public void PlayFile(string filePath, IntPtr handle) 172 | { 173 | if (SetRenderWindow((int)handle) != -1) 174 | { 175 | this.SetRenderWindow((int)handle); 176 | LoadMediaFromFile(filePath); 177 | 178 | VLCAPI.libvlc_media_player_play(libvlc_media_player_); 179 | } 180 | 181 | } 182 | 183 | public void Pause() 184 | { 185 | VLCAPI.libvlc_media_player_pause(libvlc_media_player_); 186 | } 187 | 188 | public void Stop() 189 | { 190 | VLCAPI.libvlc_media_player_stop(libvlc_media_player_); 191 | } 192 | 193 | public int Snapshot(string savePath, uint width = 0, uint height = 0) 194 | { 195 | IntPtr pathPtr = VLCUtil.StringToPtr(savePath); 196 | int result = VLCAPI.libvlc_video_take_snapshot(libvlc_media_player_, 0, pathPtr, width, height); 197 | Marshal.FreeHGlobal(pathPtr); 198 | 199 | return result; 200 | } 201 | 202 | #endregion // Play Control 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /DD监控室/VLCUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DD监控室 9 | { 10 | class VLCUtil 11 | { 12 | public static IntPtr ReturnIntPtr(byte[][] data, int length) 13 | { 14 | 15 | IntPtr[] dataIntPtrArr = new IntPtr[length]; 16 | 17 | for (int i = 0; i < length; i++) 18 | { 19 | 20 | dataIntPtrArr[i] = Marshal.AllocHGlobal(data[i].Length * sizeof(byte)); 21 | 22 | Marshal.Copy(data[i], 0, dataIntPtrArr[i], data[i].Length); 23 | 24 | } 25 | 26 | IntPtr dataIntPtr = Marshal.AllocHGlobal(length * Marshal.SizeOf(typeof(IntPtr))); 27 | 28 | Marshal.Copy(dataIntPtrArr, 0, dataIntPtr, length); 29 | 30 | return dataIntPtr; 31 | 32 | } 33 | /// 34 | /// 字符串转指针 35 | /// 36 | /// 37 | /// 38 | public static IntPtr StringToPtr(string str) 39 | { 40 | byte[] bs = Encoding.UTF8.GetBytes(str); 41 | 42 | List list = new List(100); 43 | list.AddRange(bs); 44 | list.Add((byte)0);//必须末尾增加0,c语言字符串以0结束,否则文件名乱码 45 | 46 | IntPtr pathPtr = Marshal.AllocHGlobal(list.Count); 47 | 48 | Marshal.Copy(list.ToArray(), 0, pathPtr, list.Count); 49 | return pathPtr; 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /DD监控室/Ver.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics.CodeAnalysis; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace DD监控室 12 | { 13 | [SuppressMessage("ReSharper", "InconsistentNaming")] 14 | internal static class Ver 15 | { 16 | public const string VER = "1.5.1"; 17 | public const string DATE = "(2019-3-1)"; 18 | public const string DESC = "修改API"; 19 | public static readonly string OS_VER = "(" + WinVer.SystemVersion.Major + "." + WinVer.SystemVersion.Minor + "." + WinVer.SystemVersion.Build + ")"; 20 | public static readonly string UA = "FeelyBlog/1.1 (zyzsdy@foxmail.com) BiliRoku/1.5.1 " + OS_VER + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36"; 21 | } 22 | 23 | // 检查更新 24 | public delegate void InfoEvent(object sender, string info); 25 | public delegate void CheckResultEvent(object sender, UpdateResultArgs result); 26 | public class UpdateResultArgs 27 | { 28 | public string version; 29 | public string url; 30 | } 31 | class CheckUpdate 32 | { 33 | public event InfoEvent OnInfo; 34 | public event CheckResultEvent OnResult; 35 | public CheckUpdate() 36 | { 37 | Check(); 38 | } 39 | 40 | private void Check() 41 | { 42 | Task.Run(() => 43 | { 44 | OnInfo?.Invoke(this, "检查更新。"); 45 | 46 | var ApiUrl = "https://api.github.com/repos/zyzsdy/biliroku/releases"; 47 | var wc = new WebClient(); 48 | wc.Headers.Add("Accept: application/json;q=0.9,*/*;q=0.5"); 49 | wc.Headers.Add("User-Agent: " + Ver.UA); 50 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 51 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; 52 | 53 | //发送HTTP请求获取Release信息 54 | string releaseJson = null; 55 | 56 | try 57 | { 58 | var releaseByte = wc.DownloadData(ApiUrl); 59 | releaseJson = System.Text.Encoding.GetEncoding("UTF-8").GetString(releaseByte); 60 | } 61 | catch (Exception e) 62 | { 63 | OnInfo?.Invoke(this, "检查更新失败:" + e.Message); 64 | } 65 | 66 | //提取最新版的release信息 67 | if (releaseJson != null) 68 | { 69 | try 70 | { 71 | var releaseObj = JArray.Parse(releaseJson); 72 | var releaseNote = releaseObj[0]; 73 | var tag = releaseNote["tag_name"].ToString(); 74 | var url = releaseNote["html_url"].ToString(); 75 | Version verCurrent, verNew; 76 | verCurrent = Version.Parse(Ver.VER); 77 | if (Version.TryParse(tag, out verNew)) 78 | { 79 | if (verNew > verCurrent) 80 | { 81 | try 82 | { 83 | OnResult?.Invoke(this, new UpdateResultArgs 84 | { 85 | version = tag, 86 | url = url 87 | }); 88 | } 89 | catch (Exception e) 90 | { 91 | OnInfo?.Invoke(this, "发现新版本,但是出了点罕见错误:" + e.Message); 92 | } 93 | 94 | OnInfo?.Invoke(this, "发现新版本" + tag + ",下载地址:" + url); 95 | } 96 | else 97 | { 98 | OnInfo?.Invoke(this, "当前已是最新版本。"); 99 | } 100 | } 101 | else 102 | { 103 | OnInfo?.Invoke(this, "版本信息无法解析。"); 104 | } 105 | } 106 | catch (Exception e) 107 | { 108 | OnInfo?.Invoke(this, "更新信息解析失败:" + e.Message); 109 | OnInfo?.Invoke(this, releaseJson); 110 | } 111 | } 112 | }); 113 | } 114 | } 115 | 116 | internal static class WinVer 117 | { 118 | public static readonly Version SystemVersion = GetSystemVersion(); 119 | 120 | private static Delegate GetFunctionAddress(IntPtr dllModule, string functionName, Type t) 121 | { 122 | var address = WinApi.GetProcAddress(dllModule, functionName); 123 | return address == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(address, t); 124 | } 125 | 126 | private delegate IntPtr RtlGetNtVersionNumbers(ref int dwMajor, ref int dwMinor, ref int dwBuildNumber); 127 | 128 | private static Version GetSystemVersion() 129 | { 130 | var hinst = WinApi.LoadLibrary("ntdll.dll"); 131 | var func = (RtlGetNtVersionNumbers)GetFunctionAddress(hinst, "RtlGetNtVersionNumbers", typeof(RtlGetNtVersionNumbers)); 132 | int dwMajor = 0, dwMinor = 0, dwBuildNumber = 0; 133 | func.Invoke(ref dwMajor, ref dwMinor, ref dwBuildNumber); 134 | dwBuildNumber &= 0xffff; 135 | return new Version(dwMajor, dwMinor, dwBuildNumber); 136 | } 137 | } 138 | 139 | internal static class WinApi 140 | { 141 | [DllImport("Kernel32")] 142 | public static extern IntPtr LoadLibrary(string funcname); 143 | 144 | [DllImport("Kernel32")] 145 | public static extern IntPtr GetProcAddress(IntPtr handle, string funcname); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /DD监控室/getUriSteam.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Threading.Tasks; 9 | 10 | namespace DD监控室 11 | { 12 | public class getUriSteam 13 | { 14 | public static int 流编号 = 0; 15 | //检测是否在直播 16 | public static string getBiliRoomId(string ID,string ty) 17 | { 18 | //读取设置 19 | var originalRoomId = ID; 20 | string _flvUrl = ""; 21 | //准备查找下载地址 22 | //查找真实房间号 23 | string _roomid = ""; 24 | switch (ty) 25 | { 26 | case "bilibili": 27 | _roomid = GetRoomid(ID); 28 | break; 29 | case "youtube": 30 | try 31 | { 32 | string ASDASD = MMPU.get返回网页内容("https://www.youtube.com/channel/UCcnoKv531otgPrd3NcR0mag/live"); 33 | ASDASD = ASDASD.Replace("\\\"},\\\"playbackTracking\\\"", "㈨").Split('㈨')[0].Replace("\\\"hlsManifestUrl\\\":\\\"", "㈨").Split('㈨')[1].Replace("\",\\\"probeUrl\\\"", "㈨").Split('㈨')[0].Replace("\\", ""); 34 | _roomid = MMPU.get返回网页内容(ASDASD); 35 | } 36 | catch (Exception) 37 | { 38 | _roomid = "该房间未在直播"; 39 | } 40 | break; 41 | } 42 | 43 | 44 | if (_roomid == "该房间未在直播"|| string.IsNullOrEmpty(_roomid)) 45 | { 46 | return "该房间未在直播"; 47 | } 48 | //查找真实下载地址 49 | try 50 | { 51 | _flvUrl = GetTrueUrl(_roomid); 52 | } 53 | catch 54 | { 55 | Console.WriteLine("未取得下载地址"); 56 | } 57 | return _flvUrl; 58 | } 59 | /// 60 | /// 获取网页标题 61 | /// 62 | /// 房间号 63 | /// 直播平台 64 | /// 65 | public static string GetUrlTitle(string ID,string 来源) 66 | { 67 | var roomWebPageUrl = "https://live.bilibili.com/" + ID; 68 | switch(来源) 69 | { 70 | case "bilibili": 71 | { 72 | roomWebPageUrl = "https://live.bilibili.com/" + ID; 73 | break; 74 | } 75 | case "youtube": 76 | { 77 | roomWebPageUrl = "https://www.youtube.com/channel/"+ID+"/live"; 78 | break; 79 | } 80 | default: 81 | { 82 | return "获取网页标题失败"; 83 | } 84 | 85 | } 86 | var wc = new WebClient(); 87 | wc.Encoding = Encoding.UTF8; 88 | wc.Headers.Add("Accept: text/html"); 89 | wc.Headers.Add("User-Agent: " + Ver.UA); 90 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 91 | //发送HTTP请求获取真实房间号 92 | string roomHtml; 93 | try 94 | { 95 | roomHtml = wc.DownloadString(roomWebPageUrl); 96 | } 97 | catch (Exception) 98 | { 99 | return "获取网页标题失败"; 100 | } 101 | string 标题 = ""; 102 | switch (来源) 103 | { 104 | case "bilibili": 105 | { 106 | try 107 | { 108 | 标题 = roomHtml.Replace("", "≯").Split('≯')[0].Replace("", "≯").Split('≯')[1]; 109 | } 110 | catch (Exception) 111 | { 112 | return "获取网页标题失败"; 113 | } 114 | 115 | break; 116 | } 117 | case "youtube": 118 | { 119 | 120 | 标题 = roomHtml.Replace("\"title\":\"", "㈨").Split('㈨')[1].Replace("\",", "㈨").Split('㈨')[0].Replace("\\",""); 121 | break; 122 | } 123 | default: 124 | { 125 | return "获取网页标题失败"; 126 | } 127 | 128 | } 129 | 130 | try 131 | { 132 | return 标题.Replace("- 哔哩哔哩直播,二次元弹幕直播平台", ""); 133 | } 134 | catch (Exception) 135 | { 136 | 137 | return ID; 138 | } 139 | 140 | } 141 | public static string GetRoomid(string ID) 142 | { 143 | var roomWebPageUrl = "https://api.live.bilibili.com/room/v1/Room/room_init?id=" + ID; 144 | var wc = new WebClient(); 145 | wc.Headers.Add("Accept: text/html"); 146 | wc.Headers.Add("User-Agent: " + Ver.UA); 147 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 148 | //发送HTTP请求获取真实房间号 149 | string roomHtml; 150 | try 151 | { 152 | roomHtml = wc.DownloadString(roomWebPageUrl); 153 | } 154 | catch (Exception e) 155 | { 156 | Console.WriteLine("直播初始化失败:" + e.Message); 157 | return null; 158 | } 159 | //从返回结果中提取真实房间号 160 | try 161 | { 162 | var result = JObject.Parse(roomHtml); 163 | var live_status = result["data"]["live_status"].ToString(); 164 | if(live_status!="1") 165 | { 166 | return "该房间未在直播"; 167 | } 168 | var roomid = result["data"]["room_id"].ToString(); 169 | Console.WriteLine("真实房间号: " + roomid); 170 | return roomid; 171 | } 172 | catch (Exception e) 173 | { 174 | Console.WriteLine("ERROR", "获取真实房间号失败:" + e.Message); 175 | return null; 176 | } 177 | } 178 | 179 | public static string GetTrueUrl(string roomid) 180 | { 181 | if (roomid == null) 182 | { 183 | Console.WriteLine("房间号获取错误。"); 184 | throw new Exception("No roomid"); 185 | } 186 | var apiUrl = "https://api.live.bilibili.com/room/v1/Room/playUrl?cid=" + roomid + "&otype=json&quality=0&platform=web"; 187 | 188 | //访问API获取结果 189 | var wc = new WebClient(); 190 | wc.Headers.Add("Accept: */*"); 191 | wc.Headers.Add("User-Agent: " + Ver.UA); 192 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 193 | 194 | string resultString; 195 | 196 | try 197 | { 198 | resultString = wc.DownloadString(apiUrl); 199 | } 200 | catch (Exception e) 201 | { 202 | Console.WriteLine("发送解析请求失败:" + e.Message); 203 | throw; 204 | } 205 | 206 | //解析结果 207 | try 208 | { 209 | var jsonResult = JObject.Parse(resultString); 210 | var trueUrl = jsonResult["data"]["durl"][流编号]["url"].ToString(); 211 | Console.WriteLine("地址解析成功:" + trueUrl); 212 | return trueUrl; 213 | } 214 | catch (Exception e) 215 | { 216 | Console.WriteLine("视频流地址解析失败:" + e.Message); 217 | throw; 218 | } 219 | } 220 | 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /DD监控室/new.ini: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.Form1.resources -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.Properties.Resources.resources -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.csproj.CopyComplete -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 6f4792dbd3b3194a3a04c810869e493da0b2a014 2 | -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\bin\Debug\DD监控室.exe.config 2 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\bin\Debug\DD监控室.exe 3 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\bin\Debug\DD监控室.pdb 4 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.Form1.resources 5 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.Properties.Resources.resources 6 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.csproj.GenerateResource.Cache 7 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.csproj.CoreCompileInputs.cache 8 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.exe 9 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.pdb 10 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\bin\Debug\Newtonsoft.Json.dll 11 | D:\OneDrive\代码库\C#\Git\DD播放器\DD监控室\obj\Debug\DD监控室.DmTestFrom.resources 12 | -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.exe -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DD监控室.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DD监控室.pdb -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /DD监控室/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /DD监控室/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /DD监控室/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /DD监控室/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/DD监控室/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /DD监控室/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DD监控室/ver.ini: -------------------------------------------------------------------------------- 1 | 1.0.2.3 2 | -------------------------------------------------------------------------------- /DmWin/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /DmWin/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DmWin/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace DmWin 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DmWin/DmWin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Debug 10 | AnyCPU 11 | {6D7451C6-E747-4790-A32A-E394E062F090} 12 | WinExe 13 | DmWin 14 | DmWin 15 | v4.7.1 16 | 512 17 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 18 | 4 19 | true 20 | 21 | 22 | 23 | 24 | AnyCPU 25 | true 26 | full 27 | false 28 | bin\Debug\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | 33 | 34 | AnyCPU 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | 42 | 43 | true 44 | bin\x86\Debug\ 45 | DEBUG;TRACE 46 | full 47 | x86 48 | prompt 49 | MinimumRecommendedRules.ruleset 50 | true 51 | 52 | 53 | bin\x86\Release\ 54 | TRACE 55 | false 56 | pdbonly 57 | x86 58 | prompt 59 | MinimumRecommendedRules.ruleset 60 | true 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 4.0 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | MSBuild:Compile 81 | Designer 82 | 83 | 84 | Window1.xaml 85 | 86 | 87 | App.xaml 88 | Code 89 | 90 | 91 | Designer 92 | MSBuild:Compile 93 | 94 | 95 | 96 | 97 | Code 98 | 99 | 100 | True 101 | True 102 | Resources.resx 103 | 104 | 105 | True 106 | Settings.settings 107 | True 108 | 109 | 110 | ResXFileCodeGenerator 111 | Resources.Designer.cs 112 | 113 | 114 | 115 | SettingsSingleFileGenerator 116 | Settings.Designer.cs 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | {ef042ce7-004d-4271-aa32-8c51462f57d4} 125 | MPUCL 126 | 127 | 128 | 129 | 130 | 131 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /DmWin/MMPU.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Net.NetworkInformation; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using static System.Net.Mime.MediaTypeNames; 11 | 12 | namespace DmWin 13 | { 14 | public class MMPU 15 | { 16 | private static string RoomConfigFile = "./RoomListConfig.ini"; 17 | public static List DMlist = new List(); 18 | public static int DmNum = 0; 19 | public class danmu 20 | { 21 | public int mode { get; set; }//模式 22 | public string text { get; set; }//内容 23 | public int stime { get; set; }//时间 24 | public int size { get; set; }//大小 25 | public string color { get; set; }//颜色 26 | } 27 | /// 28 | /// 获取房间的弹幕 29 | /// 30 | /// 房间号 31 | /// 32 | public static string getbalabala(string room) 33 | { 34 | string postString = "roomid=" + room + "&token=&csrf_token="; 35 | byte[] postData = Encoding.UTF8.GetBytes(postString); 36 | string url = @"http://api.live.bilibili.com/ajax/msg"; 37 | 38 | WebClient webClient = new WebClient(); 39 | webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"); 40 | webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); 41 | webClient.Headers.Add("Cookie", ""); 42 | byte[] responseData = webClient.UploadData(url, "POST", postData); 43 | string srcString = Encoding.UTF8.GetString(responseData);//解码 44 | return srcString; 45 | } 46 | 47 | /// 48 | /// 用于检查IP地址或域名是否可以使用TCP/IP协议访问(使用Ping命令),true表示Ping成功,false表示Ping失败 49 | /// 50 | /// 域名或IP 51 | /// 52 | public static bool 测试网络(string A) 53 | { 54 | try 55 | { 56 | Ping objPingSender = new Ping(); 57 | PingOptions objPinOptions = new PingOptions(); 58 | objPinOptions.DontFragment = true; 59 | string data = ""; 60 | byte[] buffer = Encoding.UTF8.GetBytes(data); 61 | int intTimeout = 120; 62 | PingReply objPinReply = objPingSender.Send(A, intTimeout, buffer, objPinOptions); 63 | string strInfo = objPinReply.Status.ToString(); 64 | if (strInfo == "Success") 65 | { 66 | return true; 67 | } 68 | else 69 | { 70 | objPinReply = objPingSender.Send("223.6.6.6", intTimeout, buffer, objPinOptions); 71 | strInfo = objPinReply.Status.ToString(); 72 | if (strInfo == "Success") 73 | { 74 | return true; 75 | } 76 | else 77 | { 78 | return false; 79 | } 80 | 81 | } 82 | } 83 | catch (Exception ex) 84 | { 85 | return false; 86 | } 87 | } 88 | /// 89 | /// 储存文件 90 | /// 91 | /// 文件完整路径 92 | /// 储存的文本内容 93 | public static void SaveFile(string file, string str) 94 | { 95 | FileStream fs = new FileStream(file, FileMode.Create); 96 | byte[] data = Encoding.UTF8.GetBytes(str); 97 | fs.Write(data, 0, data.Length); 98 | fs.Flush(); 99 | fs.Close(); 100 | } 101 | public static void InitializeRoomConfigFile() 102 | { 103 | try 104 | { 105 | ReadFile(RoomConfigFile); 106 | } 107 | catch (Exception) 108 | { 109 | 110 | SaveFile(RoomConfigFile, "{}"); 111 | } 112 | } 113 | /// 114 | /// 读取文件 115 | /// 116 | /// 文件完整路径 117 | /// 118 | public static string ReadFile(string file) 119 | { 120 | string str; 121 | StreamReader sr = new StreamReader(file, true); 122 | str = sr.ReadLine().ToString(); 123 | sr.Close(); 124 | return str; 125 | } 126 | /// 127 | /// 通过get方式返回内容 128 | /// 129 | /// 目标网页地址 130 | /// 131 | public static string get返回网页内容(string url) 132 | { 133 | string result = ""; 134 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); 135 | req.Method = "GET"; 136 | req.ContentType = "application/x-www-form-urlencoded"; 137 | 138 | HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); 139 | Stream stream = resp.GetResponseStream(); 140 | //获取响应内容 141 | using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) 142 | { 143 | result = reader.ReadToEnd(); 144 | } 145 | return result; 146 | } 147 | public static string HttpDownloadFile(string url, string path) 148 | { 149 | try 150 | { 151 | // 设置参数 152 | HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; 153 | //发送请求并获取相应回应数据 154 | HttpWebResponse response = request.GetResponse() as HttpWebResponse; 155 | //直到request.GetResponse()程序才开始向目标网页发送Post请求 156 | Stream responseStream = response.GetResponseStream(); 157 | //创建本地文件写入流 158 | Stream stream = new FileStream(path, FileMode.Create); 159 | byte[] bArr = new byte[1024]; 160 | int size = responseStream.Read(bArr, 0, (int)bArr.Length); 161 | while (size > 0) 162 | { 163 | stream.Write(bArr, 0, size); 164 | size = responseStream.Read(bArr, 0, (int)bArr.Length); 165 | } 166 | stream.Close(); 167 | responseStream.Close(); 168 | } 169 | catch (Exception) 170 | { 171 | } 172 | return path; 173 | } 174 | /// 175 | /// 检测指定文件是否存在,如果存在则返回true。 176 | /// 177 | /// 文件的绝对路径 178 | public static bool IsExistFile(string filePath) 179 | { 180 | return File.Exists(filePath); 181 | } 182 | /// 183 | /// 检测指定目录是否存在 184 | /// 185 | /// 目录的绝对路径 186 | /// 187 | public static void IsExistDirectory(string directoryPath) 188 | { 189 | if (false == System.IO.Directory.Exists(directoryPath)) 190 | { 191 | //创建pic文件夹 192 | System.IO.Directory.CreateDirectory(directoryPath); 193 | } 194 | } 195 | /// 196 | /// 删除目录 197 | /// 198 | /// 199 | public static void DelectDir(string srcPath) 200 | { 201 | try 202 | { 203 | DirectoryInfo dir = new DirectoryInfo(srcPath); 204 | FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //返回目录中所有文件和子目录 205 | foreach (FileSystemInfo i in fileinfo) 206 | { 207 | if (i is DirectoryInfo) //判断是否文件夹 208 | { 209 | DirectoryInfo subdir = new DirectoryInfo(i.FullName); 210 | subdir.Delete(true); //删除子目录和文件 211 | } 212 | else 213 | { 214 | //如果 使用了 streamreader 在删除前 必须先关闭流 ,否则无法删除 sr.close(); 215 | File.Delete(i.FullName); //删除指定文件 216 | } 217 | } 218 | } 219 | catch (Exception e) 220 | { 221 | } 222 | } 223 | public static void DelFile(string Path) 224 | { 225 | File.Delete(Path); 226 | } 227 | } 228 | } 229 | -------------------------------------------------------------------------------- /DmWin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("DmWin")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("DmWin")] 15 | [assembly: AssemblyCopyright("Copyright © 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 52 | // 方法是按如下所示使用“*”: : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /DmWin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KA.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DmWin.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /DmWin/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /DmWin/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace KA.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DmWin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DmWin/Window1.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DmWin/Window1.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | using System.Windows.Data; 10 | using System.Windows.Documents; 11 | using System.Windows.Input; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | using CefSharp.Wpf; 17 | using MPUCL; 18 | 19 | 20 | namespace DmWin 21 | { 22 | /// 23 | /// MainWindow.xaml 的交互逻辑 24 | /// 25 | public partial class Window1 : Window 26 | { 27 | string path = ""; 28 | //bool KA = false; 29 | public Window1(string A,int Fid) 30 | { 31 | InitializeComponent(); 32 | 33 | if (A != "0") 34 | { 35 | path = @"F:\DDTV\rst\1.0.2.0\index.html?Fid=" + Fid; 36 | // path= AppDomain.CurrentDomain.BaseDirectory + @"index.html?Fid=" + Fid; 37 | List cs = new List(); 38 | MMPU.DMlist.Add(cs); 39 | MMPU.DmNum.Add(0); 40 | // KA = true; 41 | 42 | Thread T1 = new Thread(new ThreadStart(delegate 43 | { 44 | ReadDanmakuList(getUriSteam.GetRoomid(A), Fid); 45 | while (true) 46 | { 47 | this.Dispatcher.Invoke( 48 | new Action( 49 | delegate 50 | { 51 | Browser.Width = Width; 52 | Browser.Height = Height; 53 | } 54 | )); 55 | 56 | Thread.Sleep(500); 57 | } 58 | })); 59 | T1.IsBackground = true; 60 | T1.Start(); 61 | //string asdsad = @"Y:\DDTV\rst\1.0.1.6\index.html?Fid=" + Fid; 62 | 63 | Browser.Address = (path); 64 | Browser.Margin = new Thickness(0, 0, 0, 0); 65 | CefSharp.CefSharpSettings.LegacyJavascriptBindingEnabled = true; 66 | Browser.RegisterJsObject("boud", new JsEvent(), new CefSharp.BindingOptions() { CamelCaseJavascriptNames = false }); 67 | } 68 | } 69 | //CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT license 70 | //CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT license 71 | //CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT license 72 | 73 | private void MainWindow_Closed1(object sender, EventArgs e) 74 | { 75 | // KA = false; 76 | } 77 | 78 | 79 | public class JsEvent 80 | { 81 | public string js { get; set; } 82 | public void ShowTest(string Fid) 83 | { 84 | int RA = int.Parse(Fid); 85 | try 86 | { 87 | string DM = MMPU.DMlist[RA][MMPU.DmNum[RA]]; 88 | MMPU.DmNum[RA]++; 89 | js = DM.Split('㈨')[1]; 90 | } 91 | catch (Exception) 92 | { 93 | js = "0"; 94 | } 95 | } 96 | } 97 | 98 | public void ReadDanmakuList(string RoomId,int Fid) 99 | { 100 | Thread T1 = new Thread(new ThreadStart(delegate { 101 | while (true) 102 | { 103 | try 104 | { 105 | MMPU.getDanmaku(RoomId, Fid); 106 | } 107 | catch (Exception) 108 | { 109 | 110 | //MessageBox.Show(ex.ToString()); 111 | } 112 | Thread.Sleep(1500); 113 | } 114 | })); 115 | T1.IsBackground = true; 116 | T1.Start(); 117 | } 118 | 119 | private void Window_SizeChanged(object sender, SizeChangedEventArgs e) 120 | { 121 | //if (KA) 122 | { 123 | Browser.Width = Width; 124 | Browser.Height = Height; 125 | //Browser.Address = (asdsad); 126 | //Browser.Margin = new Thickness(0, 0, 0, 0); 127 | //CefSharp.CefSharpSettings.LegacyJavascriptBindingEnabled = true; 128 | //Browser.RegisterJsObject("boud", new JsEvent(), new CefSharp.BindingOptions() { CamelCaseJavascriptNames = false }); 129 | } 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /DmWin/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MPUCL/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MPUCL/MMPU.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Net; 9 | using System.Net.NetworkInformation; 10 | using System.Security.Cryptography; 11 | using System.Text; 12 | using System.Text.RegularExpressions; 13 | using System.Threading; 14 | using System.Threading.Tasks; 15 | using static System.Net.Mime.MediaTypeNames; 16 | 17 | namespace MPUCL 18 | { 19 | public class MMPU 20 | { 21 | public static string RoomConfigFile = "./RoomListConfig.json"; 22 | public static List> DMlist = new List>(); 23 | public static List RoomConfigList = new List();//房间信息1List 24 | public static List RoomInfo = new List();//房间信息2List 25 | public static List RecordInfo = new List();//录制情况 26 | public static int RecNum = 0; 27 | public static int RecMax = 2; 28 | 29 | public static bool IsRefreshed = false; 30 | public static List DmNum = new List(); 31 | /// 32 | /// 弹幕开关标志位 33 | /// 34 | public static bool DanmakuEnabled = false; 35 | public class danmu 36 | { 37 | public int mode { get; set; }//模式 38 | public string text { get; set; }//内容 39 | public int stime { get; set; }//时间 40 | public int size { get; set; }//大小 41 | public string color { get; set; }//颜色 42 | } 43 | /// 44 | /// 获取房间的弹幕 45 | /// 46 | /// 房间号 47 | /// 48 | public static string getDanmaku(string room,int R) 49 | { 50 | string postString = "roomid=" + room + "&token=&csrf_token="; 51 | byte[] postData = Encoding.UTF8.GetBytes(postString); 52 | string url = @"http://api.live.bilibili.com/ajax/msg"; 53 | 54 | WebClient webClient = new WebClient(); 55 | webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"); 56 | webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); 57 | webClient.Headers.Add("Cookie", ""); 58 | byte[] responseData = webClient.UploadData(url, "POST", postData); 59 | string srcString = Encoding.UTF8.GetString(responseData);//解码 60 | try 61 | { 62 | JObject jo = (JObject)JsonConvert.DeserializeObject(srcString); 63 | for (int i = 0; i < 10; i++) 64 | { 65 | string text = jo["data"]["room"][i]["nickname"].ToString()+"㈨"+ jo["data"]["room"][i]["text"].ToString(); 66 | 67 | if (!DMlist[R].Contains(text)) 68 | { 69 | DMlist[R].Add(text); 70 | } 71 | 72 | } 73 | } 74 | catch (Exception ex) 75 | { 76 | string A = ex.ToString(); 77 | } 78 | return srcString; 79 | } 80 | 81 | /// 82 | /// 用于检查IP地址或域名是否可以使用TCP/IP协议访问(使用Ping命令),true表示Ping成功,false表示Ping失败 83 | /// 84 | /// 域名或IP 85 | /// 86 | public static bool PingTest(string Addr = "223.5.5.5") 87 | { 88 | try 89 | { 90 | string data = ""; 91 | byte[] buffer = Encoding.UTF8.GetBytes(data); 92 | int intTimeout = 120; 93 | 94 | PingOptions objPinOptions = new PingOptions(); 95 | objPinOptions.DontFragment = true; 96 | 97 | Ping objPingSender = new Ping(); 98 | PingReply objPinReply = objPingSender.Send(Addr, intTimeout, buffer, objPinOptions); 99 | string strInfo = objPinReply.Status.ToString(); 100 | if (objPinReply.Status == IPStatus.Success) 101 | { 102 | return true; 103 | } 104 | else 105 | { 106 | objPinReply = objPingSender.Send("223.6.6.6", intTimeout, buffer, objPinOptions); 107 | strInfo = objPinReply.Status.ToString(); 108 | return objPinReply.Status == IPStatus.Success; 109 | } 110 | } 111 | catch (Exception) 112 | { 113 | return false; 114 | } 115 | } 116 | 117 | public static void InitializeRoomConfigFile() 118 | { 119 | try 120 | { 121 | ReadConfigFile(RoomConfigFile); 122 | } 123 | catch (Exception) 124 | { 125 | 126 | File.WriteAllText(RoomConfigFile, "{}"); 127 | } 128 | } 129 | public static string ReadConfigFile(string file) 130 | { 131 | if (!File.Exists(file)) 132 | File.Move("./RoomListConfig.ini", file); 133 | return File.ReadAllText(file); 134 | } 135 | 136 | /// 137 | /// 通过get方式返回内容 138 | /// 139 | /// 目标网页地址 140 | /// 141 | public static string GetUrlContent(string url) 142 | { 143 | string result = ""; 144 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); 145 | req.Timeout = 3000; 146 | req.Method = "GET"; 147 | req.ContentType = "application/x-www-form-urlencoded"; 148 | 149 | HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); 150 | Stream stream = resp.GetResponseStream(); 151 | //获取响应内容 152 | using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) 153 | { 154 | result = reader.ReadToEnd(); 155 | } 156 | return result; 157 | } 158 | public static string HttpDownloadFile(string url, string path,string RoomId,string 标题,bool youtube) 159 | { 160 | string guid = Guid.NewGuid().ToString("N"); 161 | string time = DateTime.Now.ToString("yyyyMMddHHmmss").ToString(); 162 | //MMPU.RecordInfo.Add(new Room.RecordVideo { guid = guid, RoomID = RoomId, Name = 标题, File = path, Status = true, StartTime = time }); 163 | try 164 | { 165 | WebClient _wc = new WebClientto(100000); 166 | 167 | _wc.Headers.Add("Accept: */*"); 168 | _wc.Headers.Add("User-Agent: " + Ver.UA); 169 | _wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 170 | _wc.DownloadProgressChanged += _wc_DownloadProgressChanged; 171 | if (!Directory.Exists("./tmp/" + RoomId)) 172 | { 173 | Directory.CreateDirectory("./tmp/" + RoomId); 174 | } 175 | 176 | 177 | // ReSharper restore AssignNullToNotNullAttribute 178 | string filena = ""; 179 | if (youtube) 180 | { 181 | filena = "./tmp/" + RoomId + "/" + 标题 + ".flv"; 182 | MMPU.RecordInfo.Add(new Room.RecordVideo { guid = guid, RoomID = RoomId, Name = 标题, File = filena, Status = true, StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); 183 | } 184 | else 185 | { 186 | filena = "./tmp/" + RoomId + "/" + 标题 + "_" + time + ".flv"; 187 | MMPU.RecordInfo.Add(new Room.RecordVideo { guid = guid, RoomID = RoomId, Name = 标题, File = filena, Status = true, StartTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }); 188 | } 189 | RecNum++; 190 | _wc.DownloadFile(new Uri(url), filena); 191 | RecNum--; 192 | for (int i = 0; i < RecordInfo.Count; i++) 193 | { 194 | if (RecordInfo[i].guid == guid) 195 | { 196 | RecordInfo[i].Status = false; 197 | RecordInfo[i].EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(); 198 | } 199 | } 200 | return path; 201 | } 202 | catch (Exception ex) 203 | { 204 | RecNum--; 205 | for (int i = 0; i < RecordInfo.Count; i++) 206 | { 207 | if (RecordInfo[i].guid == guid) 208 | { 209 | RecordInfo[i].Status = false; 210 | RecordInfo[i].EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(); 211 | } 212 | } 213 | string sdsa = ex.ToString(); 214 | return path; 215 | } 216 | } 217 | 218 | private static void _wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) 219 | { 220 | string Size = FormatSize(e.BytesReceived); 221 | 222 | } 223 | private static string FormatSize(long size) 224 | { 225 | if (size <= 1024) 226 | { 227 | return size.ToString("F2") + "B"; 228 | } 229 | if (size <= 1048576) 230 | { 231 | return (size / 1024.0).ToString("F2") + "KB"; 232 | } 233 | if (size <= 1073741824) 234 | { 235 | return (size / 1048576.0).ToString("F2") + "MB"; 236 | } 237 | if (size <= 1099511627776) 238 | { 239 | return (size / 1073741824.0).ToString("F2") + "GB"; 240 | } 241 | return (size / 1099511627776.0).ToString("F2") + "TB"; 242 | } 243 | 244 | public static void DownloadBilibili(string A, string 标题, string time) 245 | { 246 | time = DateTime.Now.ToString("yyyyMMddHHmmss"); 247 | string Rid = getUriSteam.GetRoomid(A); 248 | HttpDownloadFile(getUriSteam.GetTrueUrl(Rid), "./tmp/" + getUriSteam.GetRoomid(A) + "_" + 标题 + "_" + time + ".flv", Rid, 标题,false); 249 | } 250 | 251 | /// 252 | /// 初始化房间列表 253 | /// 254 | public static void InitializeRoomList() 255 | { 256 | var rlc = new Room.RoomBox(); 257 | rlc = JsonConvert.DeserializeObject(ReadConfigFile(RoomConfigFile)); 258 | RoomConfigList = rlc?.data; 259 | 260 | if (RoomConfigList == null) 261 | RoomConfigList = new List(); 262 | 263 | } 264 | /// 265 | /// 获取标识 //用于区分设备统计使用人数,数据将匿名提交,不会用作其他通途 266 | /// 267 | /// 268 | public static string generateUniqueId() 269 | { 270 | var valHWID = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\0001", "HwProfileGuid", ""); 271 | return valHWID; 272 | } 273 | 274 | } 275 | } 276 | -------------------------------------------------------------------------------- /MPUCL/MPUCL.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EF042CE7-004D-4271-AA32-8C51462F57D4} 8 | WinExe 9 | MPUCL 10 | MPUCL 11 | v4.7.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | true 36 | bin\x86\Debug\ 37 | DEBUG;TRACE 38 | full 39 | x86 40 | prompt 41 | MinimumRecommendedRules.ruleset 42 | true 43 | 44 | 45 | bin\x86\Release\ 46 | TRACE 47 | false 48 | pdbonly 49 | x86 50 | prompt 51 | MinimumRecommendedRules.ruleset 52 | true 53 | 54 | 55 | 56 | False 57 | ..\..\..\..\..\..\Git_Non\东方网页项目\留言\bin\Newtonsoft.Json.dll 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Component 80 | 81 | 82 | ResXFileCodeGenerator 83 | Resources.Designer.cs 84 | Designer 85 | 86 | 87 | True 88 | Resources.resx 89 | 90 | 91 | SettingsSingleFileGenerator 92 | Settings.Designer.cs 93 | 94 | 95 | True 96 | Settings.settings 97 | True 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /MPUCL/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace MPUCL 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | //Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MPUCL/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("MPUCL")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MPUCL")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("ef042ce7-004d-4271-aa32-8c51462f57d4")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /MPUCL/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MPUCL.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MPUCL.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /MPUCL/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /MPUCL/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MPUCL.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MPUCL/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MPUCL/Room.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MPUCL 9 | { 10 | public class Room 11 | { 12 | public class RoomBox 13 | { 14 | public List data { get; set; } 15 | } 16 | 17 | public class RoomCadr 18 | { 19 | public string Name { get; set; } 20 | public string RoomNumber { get; set; } 21 | public string Types { get; set; } = "bilibili"; 22 | public bool status { get; set; } =false; 23 | public bool VideoStatus { get; set; } = false; 24 | 25 | [JsonProperty(PropertyName = "Ty")] 26 | private bool statusAlt1 { set { status = value;} } 27 | } 28 | 29 | /// 30 | /// 房间的动态数据 31 | /// 32 | public class RoomInfo 33 | { 34 | public string Name { get; set; } 35 | public string RoomNumber { get; set; } 36 | public string Text { get; set; } 37 | public string steam { get; set; } 38 | public bool status { get; set; } 39 | public bool Top { get; set; } 40 | 41 | } 42 | 43 | public class RecordVideo 44 | { 45 | public string guid { get; set; } 46 | public string RoomID { get; set; } 47 | public string Name { get; set; } 48 | public bool Status { get; set; } 49 | public string File { get; set; } 50 | public string StartTime { get; set; } = ""; 51 | public string EndTime { get; set; } = ""; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /MPUCL/Ver.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics.CodeAnalysis; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace MPUCL 12 | { 13 | [SuppressMessage("ReSharper", "InconsistentNaming")] 14 | internal static class Ver 15 | { 16 | public const string VER = "1.5.1"; 17 | public const string DATE = "(2019-3-1)"; 18 | public const string DESC = "修改API"; 19 | public static readonly string OS_VER = "(" + WinVer.SystemVersion.Major + "." + WinVer.SystemVersion.Minor + "." + WinVer.SystemVersion.Build + ")"; 20 | public static readonly string UA = "FeelyBlog/1.1 (zyzsdy@foxmail.com) BiliRoku/1.5.1 " + OS_VER + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36"; 21 | } 22 | 23 | // 检查更新 24 | public delegate void InfoEvent(object sender, string info); 25 | public delegate void CheckResultEvent(object sender, UpdateResultArgs result); 26 | public class UpdateResultArgs 27 | { 28 | public string version; 29 | public string url; 30 | } 31 | 32 | 33 | internal static class WinVer 34 | { 35 | public static readonly Version SystemVersion = GetSystemVersion(); 36 | 37 | private static Delegate GetFunctionAddress(IntPtr dllModule, string functionName, Type t) 38 | { 39 | var address = WinApi.GetProcAddress(dllModule, functionName); 40 | return address == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(address, t); 41 | } 42 | 43 | private delegate IntPtr RtlGetNtVersionNumbers(ref int dwMajor, ref int dwMinor, ref int dwBuildNumber); 44 | 45 | private static Version GetSystemVersion() 46 | { 47 | var hinst = WinApi.LoadLibrary("ntdll.dll"); 48 | var func = (RtlGetNtVersionNumbers)GetFunctionAddress(hinst, "RtlGetNtVersionNumbers", typeof(RtlGetNtVersionNumbers)); 49 | int dwMajor = 0, dwMinor = 0, dwBuildNumber = 0; 50 | func.Invoke(ref dwMajor, ref dwMinor, ref dwBuildNumber); 51 | dwBuildNumber &= 0xffff; 52 | return new Version(dwMajor, dwMinor, dwBuildNumber); 53 | } 54 | } 55 | 56 | internal static class WinApi 57 | { 58 | [DllImport("Kernel32")] 59 | public static extern IntPtr LoadLibrary(string funcname); 60 | 61 | [DllImport("Kernel32")] 62 | public static extern IntPtr GetProcAddress(IntPtr handle, string funcname); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /MPUCL/WebClientto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MPUCL 9 | { 10 | public class WebClientto : WebClient 11 | { 12 | /// 13 | /// 过期时间 14 | /// 15 | public int Timeout { get; set; } 16 | 17 | public WebClientto(int timeout) 18 | { 19 | Timeout = timeout; 20 | } 21 | 22 | /// 23 | /// 重写GetWebRequest,添加WebRequest对象超时时间 24 | /// 25 | /// 26 | /// 27 | protected override WebRequest GetWebRequest(Uri address) 28 | { 29 | HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address); 30 | request.Timeout = Timeout; 31 | request.ReadWriteTimeout = Timeout; 32 | return request; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /MPUCL/getUriSteam.CS: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Threading.Tasks; 9 | 10 | namespace MPUCL 11 | { 12 | public class getUriSteam 13 | { 14 | public static int StreamId = 0; 15 | //检测是否在直播 16 | public static string getBiliRoomId(string ID, string ty) 17 | { 18 | //读取设置 19 | var originalRoomId = ID; 20 | string _flvUrl = ""; 21 | //准备查找下载地址 22 | //查找真实房间号 23 | string _roomid = ""; 24 | switch (ty) 25 | { 26 | case "bilibili": 27 | _roomid = GetRoomid(ID); 28 | break; 29 | case "youtube": 30 | try 31 | { 32 | string ASDASD = MMPU.GetUrlContent("https://www.youtube.com/channel/UCcnoKv531otgPrd3NcR0mag/live"); 33 | ASDASD = ASDASD.Replace("\\\"},\\\"playbackTracking\\\"", "㈨").Split('㈨')[0].Replace("\\\"hlsManifestUrl\\\":\\\"", "㈨").Split('㈨')[1].Replace("\",\\\"probeUrl\\\"", "㈨").Split('㈨')[0].Replace("\\", ""); 34 | _roomid = MMPU.GetUrlContent(ASDASD); 35 | } 36 | catch (Exception) 37 | { 38 | _roomid = "该房间未在直播"; 39 | } 40 | break; 41 | } 42 | 43 | 44 | if (_roomid == "该房间未在直播" || string.IsNullOrEmpty(_roomid)) 45 | { 46 | return "该房间未在直播"; 47 | } 48 | //查找真实下载地址 49 | try 50 | { 51 | _flvUrl = GetTrueUrl(_roomid); 52 | } 53 | catch 54 | { 55 | Console.WriteLine("未取得下载地址"); 56 | } 57 | return _flvUrl; 58 | } 59 | /// 60 | /// 获取网页标题 61 | /// 62 | /// 房间号 63 | /// 直播平台 64 | /// 65 | public static string GetUrlTitle(string ID, string source) 66 | { 67 | int c = 0; 68 | a: 69 | var roomWebPageUrl = "https://live.bilibili.com/" + ID; 70 | switch (source) 71 | { 72 | case "bilibili": 73 | { 74 | roomWebPageUrl = "https://live.bilibili.com/" + ID; 75 | break; 76 | } 77 | case "youtube": 78 | { 79 | roomWebPageUrl = "https://www.youtube.com/channel/" + ID + "/live"; 80 | break; 81 | } 82 | default: 83 | { 84 | if(c==0) 85 | { 86 | c++; 87 | goto a; 88 | } 89 | return "获取网页标题失败"; 90 | } 91 | 92 | } 93 | var wc = new WebClient(); 94 | wc.Encoding = Encoding.UTF8; 95 | wc.Headers.Add("Accept: text/html"); 96 | wc.Headers.Add("User-Agent: " + Ver.UA); 97 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 98 | //发送HTTP请求获取真实房间号 99 | string roomHtml; 100 | try 101 | { 102 | roomHtml = wc.DownloadString(roomWebPageUrl); 103 | } 104 | catch (Exception) 105 | { 106 | if (c == 0) 107 | { 108 | c++; 109 | goto a; 110 | } 111 | return "获取网页标题失败"; 112 | } 113 | string 标题 = ""; 114 | switch (source) 115 | { 116 | case "bilibili": 117 | { 118 | try 119 | { 120 | 标题 = roomHtml.Replace("", "≯").Split('≯')[0].Replace("", "≯").Split('≯')[1]; 121 | } 122 | catch (Exception) 123 | { 124 | if (c == 0) 125 | { 126 | c++; 127 | goto a; 128 | } 129 | return "获取网页标题失败"; 130 | } 131 | 132 | break; 133 | } 134 | case "youtube": 135 | { 136 | 137 | 标题 = roomHtml.Replace("\"title\":\"", "㈨").Split('㈨')[1].Replace("\",", "㈨").Split('㈨')[0].Replace("\\", ""); 138 | break; 139 | } 140 | default: 141 | { 142 | if (c == 0) 143 | { 144 | c++; 145 | goto a; 146 | } 147 | return "获取网页标题失败"; 148 | } 149 | 150 | } 151 | 152 | try 153 | { 154 | return 标题.Replace("- 哔哩哔哩直播,二次元弹幕直播平台", ""); 155 | } 156 | catch (Exception) 157 | { 158 | 159 | return ID; 160 | } 161 | 162 | } 163 | public static string GetRoomid(string ID) 164 | { 165 | var roomWebPageUrl = "https://api.live.bilibili.com/room/v1/Room/room_init?id=" + ID; 166 | var wc = new WebClient(); 167 | wc.Headers.Add("Accept: text/html"); 168 | wc.Headers.Add("User-Agent: " + Ver.UA); 169 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 170 | //发送HTTP请求获取真实房间号 171 | string roomHtml; 172 | try 173 | { 174 | roomHtml = wc.DownloadString(roomWebPageUrl); 175 | } 176 | catch (Exception e) 177 | { 178 | Console.WriteLine("直播初始化失败:" + e.Message); 179 | return null; 180 | } 181 | //从返回结果中提取真实房间号 182 | try 183 | { 184 | var result = JObject.Parse(roomHtml); 185 | var live_status = result["data"]["live_status"].ToString(); 186 | if (live_status != "1") 187 | { 188 | return "该房间未在直播"; 189 | } 190 | var roomid = result["data"]["room_id"].ToString(); 191 | Console.WriteLine("真实房间号: " + roomid); 192 | return roomid; 193 | } 194 | catch (Exception e) 195 | { 196 | Console.WriteLine("ERROR", "获取真实房间号失败:" + e.Message); 197 | return null; 198 | } 199 | } 200 | 201 | public static string GetTrueUrl(string roomid) 202 | { 203 | if (roomid == null) 204 | { 205 | Console.WriteLine("房间号获取错误。"); 206 | throw new Exception("No roomid"); 207 | } 208 | var apiUrl = "https://api.live.bilibili.com/room/v1/Room/playUrl?cid=" + roomid + "&otype=json&quality=0&platform=web"; 209 | 210 | //访问API获取结果 211 | var wc = new WebClient(); 212 | wc.Headers.Add("Accept: */*"); 213 | wc.Headers.Add("User-Agent: " + Ver.UA); 214 | wc.Headers.Add("Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4"); 215 | 216 | string resultString; 217 | 218 | try 219 | { 220 | resultString = wc.DownloadString(apiUrl); 221 | } 222 | catch (Exception e) 223 | { 224 | Console.WriteLine("发送解析请求失败:" + e.Message); 225 | throw; 226 | } 227 | 228 | //解析结果 229 | try 230 | { 231 | var jsonResult = JObject.Parse(resultString); 232 | var trueUrl = jsonResult["data"]["durl"][StreamId]["url"].ToString(); 233 | Console.WriteLine("地址解析成功:" + trueUrl); 234 | return trueUrl; 235 | } 236 | catch (Exception e) 237 | { 238 | Console.WriteLine("视频流地址解析失败:" + e.Message); 239 | throw; 240 | } 241 | } 242 | 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 本项目已归档,已经全部迁移至新项目,请跳转到新项目,[点击跳转到DDTV项目页](https://github.com/CHKZL/DDTV) 2 | 3 | # DDTV2.0发布! 4 | ## 全新的界面和更稳定的功能! 5 | 6 | [点击跳转到2.0发布和下载网页](https://github.com/CHKZL/DDTV) 7 | 8 | (https://github.com/CHKZL/DDTV) 9 | 10 | -- 11 | 12 | # DDTV 13 | DD导播中心 14 | ![DD导播中心](https://github.com/CHKZL/DDTV/blob/master/src/DDTV.png) 15 | 16 | ## 为何要写这个东西 17 | ~~当然是为了方便的爱着大家啊(震声!~~ 18 | ~~我是单推(破音!!~~ 19 | 估摸着可以给DD国添砖加瓦,就想了一下需求,DUANG~就变出来了。 20 | 21 | 22 | 23 | ## 功能完成情况 24 | * 多路直播监控,可自定义监听房间,摸鱼中\直播中一目了然 25 | * 多窗口随意排列,大小随意 26 | * 每路声音可单独调整 27 | * 截图保存/手动录像/开播自动录像 28 | * 监控列表开播提示 29 | * 直播流选择 30 | * 在标题滑动鼠标滚轮修改窗口音量 31 | * 缩小到系统托盘后台监听 32 | * 弹幕显示 33 | * 油管直播流下载(不提供油管的直播流内置观看,请善用本地播放器 34 | * 开播,录像气泡提示 35 | * B站,油管多线程异步直播缓存(至多512个,达到这个数量前一般网络先会受不了) 36 | * B站主站视频下载 37 | * 直播弹幕记录 38 | * 直播弹幕发送功能 39 | 40 | ~~暂时还没想到其他的需求,欢迎提供~~ 41 | 42 | ## 关于监控列表 43 | 因为我自己平时也在用,所以会默认有一些,如果不需要,选择过后点击删除就行。 44 | 或者把软件执行文件根目录中的RoomListConfig.json文件删除即可。 45 | 46 | ### 在更新软件的时候请备份好RoomListConfig.json文件,该文件是监控房间配置文件 47 | ### 在更新软件的时候请备份好RoomListConfig.json文件,该文件是监控房间配置文件 48 | ### 在更新软件的时候请备份好RoomListConfig.json文件,该文件是监控房间配置文件 49 | 50 | ## 界面 51 | 主界面DD中: 52 | 53 | ![主界面](https://github.com/CHKZL/DDTV/blob/master/src/5.png) 54 | 55 | 56 | 开播提示: 57 | 58 | ![开播提示](https://github.com/CHKZL/DDTV/blob/master/src/4.png) 59 | 60 | ## 兼容性 61 | 需要.net4.7.1环境 62 | 如果桌面缩放布局比率不是100%,打开弹幕层可能会出现弹幕显示位置和大小错位的问题。 63 | 64 | ## FA♂Q 65 | 有啥问题想到再写( 66 | 67 | ## 捐助 68 | ### 捐助表示您对我这个项目的认可,也能激励我继续开发更多好的项目 69 | 70 | * 支付宝 71 | 72 | ![支付宝](https://github.com/CHKZL/DDTV/blob/master/src/ZFB.png) 73 | * 微信 74 | 75 | ![微信](https://github.com/CHKZL/DDTV/blob/master/src/WX.png) 76 | -------------------------------------------------------------------------------- /src/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/1.png -------------------------------------------------------------------------------- /src/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/2.png -------------------------------------------------------------------------------- /src/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/4.png -------------------------------------------------------------------------------- /src/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/5.png -------------------------------------------------------------------------------- /src/DDTV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/DDTV.png -------------------------------------------------------------------------------- /src/Ver.ini: -------------------------------------------------------------------------------- 1 | 2.0.2.3b 2 | -------------------------------------------------------------------------------- /src/Ver_Text.ini: -------------------------------------------------------------------------------- 1 | DDTV2.0发布! 2 | DDTV1.0的续作 3 | 使用WPF完全重写了,修改了很多在1.0不科学的地方。 4 | 全新的界面,更加稳定的功能! 5 | 6 | 在1.0的项目页面中可以直接跳转到2.0的项目和下载界面 7 | 如果github下载卡顿也可以到307156949群共享下载 8 | -------------------------------------------------------------------------------- /src/WX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/WX.png -------------------------------------------------------------------------------- /src/ZFB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CHKZL/DDTV_Old/da1a0f1a028891451bc1898e06f9087f73999ac9/src/ZFB.png --------------------------------------------------------------------------------