├── Wiki ├── Home ├── Mac-Linux │ ├── actions.png │ └── claimpms.sh.png └── Windows │ └── Claimit.exe.png ├── Windows └── ClaimIt │ ├── app.config │ ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx │ ├── Program.cs │ ├── ClaimIt.csproj │ ├── Form1.resx │ ├── Form1.Designer.cs │ └── Form1.cs ├── README.md ├── ClaimIt.sln ├── .gitattributes ├── .gitignore ├── linux └── claimpms.sh └── LICENSE /Wiki/Home: -------------------------------------------------------------------------------- 1 | Placeholder 2 | -------------------------------------------------------------------------------- /Wiki/Mac-Linux/actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ukdtom/ClaimIt/HEAD/Wiki/Mac-Linux/actions.png -------------------------------------------------------------------------------- /Wiki/Windows/Claimit.exe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ukdtom/ClaimIt/HEAD/Wiki/Windows/Claimit.exe.png -------------------------------------------------------------------------------- /Wiki/Mac-Linux/claimpms.sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ukdtom/ClaimIt/HEAD/Wiki/Mac-Linux/claimpms.sh.png -------------------------------------------------------------------------------- /Windows/ClaimIt/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace ClaimIt 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ClaimIt 2 | [![GitHub issues](https://img.shields.io/github/issues/ukdtom/ClaimIt.svg?style=flat)](https://github.com/ukdtom/ClaimIt/issues) 3 | [![Release](https://img.shields.io/github/release/ukdtom/ClaimIt.svg?style=flat)](https://github.com/ukdtom/ClaimIt/releases/latest) 4 | [![Download latest release](https://img.shields.io/github/downloads/ukdtom/ClaimIt/latest/total.svg)](https://github.com/ukdtom/ClaimIt/releases/latest) 5 | [![Download total](https://img.shields.io/github/downloads/ukdtom/ClaimIt/total.svg)](https://github.com/ukdtom/ClaimIt/releases) 6 | [![master](https://img.shields.io/badge/master-stable-green.svg?maxAge=2592000)]() 7 | ![Maintenance](https://img.shields.io/badge/Maintained-Yes-green.svg) 8 | 9 | *** 10 | ClaimIt for [Plex Media Server](https://support.plex.tv/hc/en-us) 11 | 12 | This is intended for people installing a Plex Media Server, and when launched, can't get past "Looking for Server..." 13 | 14 | For more details, see the [ClaimIt Wiki](https://github.com/ukdtom/ClaimIt/wiki) 15 | 16 | 17 | **NOTE:** _For Windows users, we recommend you use [ClaimPMS4Win](https://github.com/ukdtom/ClaimPMS4Win/wiki) instead._ 18 | -------------------------------------------------------------------------------- /Windows/ClaimIt/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 ClaimIt.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ClaimIt.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.271 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClaimIt", "Windows\ClaimIt\ClaimIt.csproj", "{EA7183C8-6767-42C2-8083-02BA9FD43C99}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3CBACAE4-6D6C-4624-9861-AFAD1B2A43DE}" 9 | ProjectSection(SolutionItems) = preProject 10 | .gitattributes = .gitattributes 11 | .gitignore = .gitignore 12 | linux\claimpms.sh = linux\claimpms.sh 13 | LICENSE = LICENSE 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {EA7183C8-6767-42C2-8083-02BA9FD43C99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {EA7183C8-6767-42C2-8083-02BA9FD43C99}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {EA7183C8-6767-42C2-8083-02BA9FD43C99}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {EA7183C8-6767-42C2-8083-02BA9FD43C99}.Release|Any CPU.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {EAD016C1-3C37-41CC-B4BE-E2C392E33637} 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ClaimIt")] 9 | [assembly: AssemblyDescription("Will Claim a Plex Media Server")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Community, Created by dane22, a Plex Community Member")] 12 | [assembly: AssemblyProduct("ClaimIt")] 13 | [assembly: AssemblyCopyright("https://github.com/ukdtom/ClaimIt/blob/master/LICENSE")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ea7183c8-6767-42c2-8083-02ba9fd43c99")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.0.0")] 36 | [assembly: AssemblyFileVersion("1.1.0.0")] 37 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Properties/Resources.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 ClaimIt.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClaimIt.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Windows/ClaimIt/ClaimIt.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EA7183C8-6767-42C2-8083-02BA9FD43C99} 8 | WinExe 9 | ClaimIt 10 | ClaimIt 11 | v4.5 12 | 512 13 | true 14 | false 15 | 16 | publish\ 17 | true 18 | Disk 19 | false 20 | Foreground 21 | 7 22 | Days 23 | false 24 | false 25 | true 26 | 1 27 | 1.0.0.%2a 28 | false 29 | true 30 | true 31 | 32 | 33 | AnyCPU 34 | true 35 | full 36 | false 37 | bin\Debug\ 38 | DEBUG;TRACE 39 | prompt 40 | 4 41 | false 42 | 43 | 44 | AnyCPU 45 | pdbonly 46 | true 47 | bin\Release\ 48 | TRACE 49 | prompt 50 | 4 51 | false 52 | 53 | 54 | 69883B134EDA276A0355AD8725C803A49B787A2C 55 | 56 | 57 | ClaimIt_TemporaryKey.pfx 58 | 59 | 60 | true 61 | 62 | 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | Form 81 | 82 | 83 | Form1.cs 84 | 85 | 86 | 87 | 88 | Form1.cs 89 | 90 | 91 | ResXFileCodeGenerator 92 | Resources.Designer.cs 93 | Designer 94 | 95 | 96 | True 97 | Resources.resx 98 | True 99 | 100 | 101 | 102 | 103 | SettingsSingleFileGenerator 104 | Settings.Designer.cs 105 | 106 | 107 | True 108 | Settings.settings 109 | True 110 | 111 | 112 | 113 | 114 | False 115 | .NET Framework 3.5 SP1 116 | false 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Windows/ClaimIt/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 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Form1.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/* 2 | !.vscode/settings.json 3 | !.vscode/tasks.json 4 | !.vscode/launch.json 5 | !.vscode/extensions.json 6 | 7 | ## Ignore Visual Studio temporary files, build results, and 8 | ## files generated by popular Visual Studio add-ons. 9 | ## 10 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 11 | 12 | # User-specific files 13 | *.rsuser 14 | *.suo 15 | *.user 16 | *.userosscache 17 | *.sln.docstates 18 | 19 | # User-specific files (MonoDevelop/Xamarin Studio) 20 | *.userprefs 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | [Aa][Rr][Mm]/ 30 | [Aa][Rr][Mm]64/ 31 | bld/ 32 | [Bb]in/ 33 | [Oo]bj/ 34 | [Ll]og/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUNIT 49 | *.VisualState.xml 50 | TestResult.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # StyleCop 66 | StyleCopReport.xml 67 | 68 | # Files built by Visual Studio 69 | *_i.c 70 | *_p.c 71 | *_h.h 72 | *.ilk 73 | *.meta 74 | *.obj 75 | *.iobj 76 | *.pch 77 | *.pdb 78 | *.ipdb 79 | *.pgc 80 | *.pgd 81 | *.rsp 82 | *.sbr 83 | *.tlb 84 | *.tli 85 | *.tlh 86 | *.tmp 87 | *.tmp_proj 88 | *_wpftmp.csproj 89 | *.log 90 | *.vspscc 91 | *.vssscc 92 | .builds 93 | *.pidb 94 | *.svclog 95 | *.scc 96 | 97 | # Chutzpah Test files 98 | _Chutzpah* 99 | 100 | # Visual C++ cache files 101 | ipch/ 102 | *.aps 103 | *.ncb 104 | *.opendb 105 | *.opensdf 106 | *.sdf 107 | *.cachefile 108 | *.VC.db 109 | *.VC.VC.opendb 110 | 111 | # Visual Studio profiler 112 | *.psess 113 | *.vsp 114 | *.vspx 115 | *.sap 116 | 117 | # Visual Studio Trace Files 118 | *.e2e 119 | 120 | # TFS 2012 Local Workspace 121 | $tf/ 122 | 123 | # Guidance Automation Toolkit 124 | *.gpState 125 | 126 | # ReSharper is a .NET coding add-in 127 | _ReSharper*/ 128 | *.[Rr]e[Ss]harper 129 | *.DotSettings.user 130 | 131 | # JustCode is a .NET coding add-in 132 | .JustCode 133 | 134 | # TeamCity is a build add-in 135 | _TeamCity* 136 | 137 | # DotCover is a Code Coverage Tool 138 | *.dotCover 139 | 140 | # AxoCover is a Code Coverage Tool 141 | .axoCover/* 142 | !.axoCover/settings.json 143 | 144 | # Visual Studio code coverage results 145 | *.coverage 146 | *.coveragexml 147 | 148 | # NCrunch 149 | _NCrunch_* 150 | .*crunch*.local.xml 151 | nCrunchTemp_* 152 | 153 | # MightyMoose 154 | *.mm.* 155 | AutoTest.Net/ 156 | 157 | # Web workbench (sass) 158 | .sass-cache/ 159 | 160 | # Installshield output folder 161 | [Ee]xpress/ 162 | 163 | # DocProject is a documentation generator add-in 164 | DocProject/buildhelp/ 165 | DocProject/Help/*.HxT 166 | DocProject/Help/*.HxC 167 | DocProject/Help/*.hhc 168 | DocProject/Help/*.hhk 169 | DocProject/Help/*.hhp 170 | DocProject/Help/Html2 171 | DocProject/Help/html 172 | 173 | # Click-Once directory 174 | publish/ 175 | 176 | # Publish Web Output 177 | *.[Pp]ublish.xml 178 | *.azurePubxml 179 | # Note: Comment the next line if you want to checkin your web deploy settings, 180 | # but database connection strings (with potential passwords) will be unencrypted 181 | *.pubxml 182 | *.publishproj 183 | 184 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 185 | # checkin your Azure Web App publish settings, but sensitive information contained 186 | # in these scripts will be unencrypted 187 | PublishScripts/ 188 | 189 | # NuGet Packages 190 | *.nupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | # ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true 241 | **/wwwroot/lib/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 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 | -------------------------------------------------------------------------------- /linux/claimpms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #************************************************************************ 3 | # Script to claim a Plex Media Server 4 | # Will prompt for: 5 | # * plex.tv username 6 | # * plex.tv password 7 | # * IP Address of your unclaimed Plex Media Server 8 | # 9 | # Made by dane22, a Plex community member 10 | # Mark Walker/ZiGGiMoN, a Plex hobbyist 11 | # 12 | # Version: 1.1.0.0 13 | # 14 | # Home: https://github.com/ukdtom/ClaimIt 15 | #************************************************************************ 16 | 17 | #************************************************************************ 18 | # Functions 19 | #************************************************************************ 20 | 21 | function ComparePwd() 22 | # Compare password entered 23 | { 24 | if [ $passvar == $passvar2 ] 25 | then 26 | return 0 27 | else 28 | echo "Password mismatch" 29 | exit 1 # terminate and indicate error 30 | fi 31 | } 32 | 33 | function ValidateIP() 34 | # Check if IP has valid format 35 | { 36 | if [ "`echo $ippms | awk -F'.' 'NF==4 && $1 > 0 && $1<256 && $2<256 && $3<256 && $4<256 && !/\.\./'`" == "$ippms" ] 37 | then 38 | if echo "$ippms" | grep -Eq '(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)' >/dev/null; then 39 | return 0 40 | else 41 | echo "The IP address entered is not in Private Address Space" 42 | echo "Either '127.0.0.1' or an address in private address space is needed to claim a server" 43 | echo "See: https://github.com/ukdtom/ClaimIt/wiki/IP-Address-requirement" 44 | exit 1 45 | fi 46 | return 0 47 | else 48 | echo "IP is not valid" 49 | exit 1 # terminate and indicate error 50 | fi 51 | } 52 | 53 | function GetClaimToken() 54 | #***************************************** 55 | #* Get claim token from plex.tv 56 | #* Needs the following params: 57 | #* 1 Param: X-Plex-Token 58 | #* 2 Param: X-Plex-Client-Identifier 59 | #***************************************** 60 | { 61 | url="https://plex.tv/api/claim/token?X-Plex-Token=$1&X-Plex-Client-Identifier=ClaimIt-$2" 62 | local response=$(curl -i -k -L -s $url) 63 | # Grap the token 64 | local claimtoken=$(printf %s "$response" | awk -F= '$1=="token"{print $2}' RS=' '| cut -d '"' -f 2) 65 | # grap the return code 66 | local http_status=$(echo "$response" | grep HTTP | awk '{print $2}') 67 | if [ -z "$http_status" ]; 68 | then 69 | exit 1 70 | else 71 | if [ $http_status -eq "200" ] 72 | then 73 | echo "$claimtoken" 74 | exit 0 75 | else 76 | exit 1 77 | fi 78 | fi 79 | } 80 | 81 | function GetLoginToken() 82 | #***************************************** 83 | #* Get user auth token from plex.tv 84 | #* Needs the following params: 85 | #* 1 Param: UserName 86 | #* 2 Param: Password 87 | #* 3 Param: X-Plex-Client-Identifier 88 | #***************************************** 89 | { 90 | url="https://plex.tv/api/v2/users/signin" 91 | local response=$(curl -X POST -i -k -L -s $url --data-urlencode "login=$1" --data-urlencode "password=$2" --data-urlencode "X-Plex-Client-Identifier=ClaimIt-$3") 92 | # Grap the token 93 | local UserToken=$(printf %s "$response" | awk -F= '$1=="authToken"{print $2}' RS=' '| cut -d '"' -f 2) 94 | # grap the return code 95 | local http_status=$(echo "$response" | grep HTTP | awk '{print $2}') 96 | if [ -z "$http_status" ]; 97 | then 98 | exit 1 99 | else 100 | if [ "$http_status" -lt "202" ] 101 | then 102 | echo "$UserToken" 103 | else 104 | exit 1 105 | fi 106 | fi 107 | } 108 | 109 | function GetClientIdentifier() 110 | # Get PMS machineIdentifier 111 | { 112 | url="http://$ippms:32400/identity" 113 | content=$(curl -i -k -L -s $url) 114 | local machineIdentifier=$(printf %s "$content" | awk -F= '$1=="machineIdentifier"{print $2}' RS=' '| cut -d '"' -f 2) 115 | local http_status=$(echo "$content" | grep HTTP | awk '{print $2}') 116 | if [ -z "$http_status" ]; 117 | then 118 | exit 1 119 | else 120 | if [ $http_status -eq "200" ] 121 | then 122 | if [ -z "$machineIdentifier" ]; 123 | then 124 | exit 1 125 | else 126 | echo "$machineIdentifier" 127 | fi 128 | else 129 | exit 1 130 | fi 131 | fi 132 | } 133 | 134 | function Claimit() 135 | #***************************************** 136 | #* Claim a PMS Server 137 | #* Needs the following params: 138 | #* 1 Param: $ippms 139 | #* 2 Param: $XPlexClaimtoken 140 | #* 3 Param: $XPlexClientIdentifier 141 | #* 4 Param: $UserToken 142 | #***************************************** 143 | { 144 | url="http://$1:32400/myplex/claim?token=$2&X-Plex-Client-Identifier=ClaimIt-$3&X-Plex-Token=$4" 145 | content=$(curl -X POST -i -k -L -s $url) 146 | local http_status=$(echo "$content" | grep HTTP | awk '{print $2}') 147 | if [ -z "$http_status" ]; 148 | then 149 | echo "Fatal error happened" 150 | echo "HTTP returned Status $http_status" 151 | exit 1 152 | else 153 | if [ $http_status -eq "200" ]; 154 | then 155 | echo "Claiming server ok $http_status" 156 | echo "" 157 | echo "" 158 | echo "Please close your browser, reopen, and browse to http://$1:32400/web" 159 | exit 0 160 | else 161 | echo "Fatal error happened" 162 | echo "HTTP returned Status $http_status" 163 | exit 1 164 | fi 165 | fi 166 | } 167 | 168 | #************************************************************************ 169 | #* Main 170 | #************************************************************************ 171 | clear 172 | 173 | echo "************************************************************************" 174 | echo "* Script to claim a Plex Media Server" 175 | echo "* Will prompt for" 176 | echo "* * plex.tv username" 177 | echo "* * plex.tv password" 178 | echo "* * IP Address of your unclaimed Plex Media Server" 179 | echo "*" 180 | echo "*" 181 | echo "* Made by dane22, a Plex community member" 182 | echo "* And Mark Walker/ZiGGiMoN, a Plex hobbyist" 183 | echo "*" 184 | echo "* Version 1.1.0.0" 185 | echo "*" 186 | echo "* To see the manual, please visit https://github.com/ukdtom/ClaimIt/wiki" 187 | echo "************************************************************************" 188 | 189 | read -p 'plex.tv Username: ' uservar 190 | echo '' 191 | read -sp 'plex.tv Password: ' passvar 192 | echo '' 193 | read -sp 'plex.tv Password Repeated: ' passvar2 194 | echo '' 195 | read -p 'IP Address of PMS server: ' ippms 196 | 197 | # Compare pwd entered 198 | echo "Comparing entered passwords" 199 | ComparePwd 200 | echo "Comparing entered passwords ok" 201 | 202 | echo "Validating IP address" 203 | if ! CheckIPValidity=$(ValidateIP); 204 | then 205 | echo "******** ERROR ********" 206 | echo "The IP address entered is not in Private Address Space" 207 | echo "Either '127.0.0.1' or an address in private address space is needed to claim a server" 208 | echo "See: https://github.com/ukdtom/ClaimIt/wiki/IP-Address-requirement" 209 | exit 1 210 | fi 211 | 212 | echo "Getting PMS Server Identifier" 213 | if ! XPlexClientIdentifier=$(GetClientIdentifier); 214 | then 215 | echo "******** ERROR ********" 216 | echo "We failed to get the Plex Media Server ID" 217 | echo "Please check server is up and running, as well as the IP address entered" 218 | exit 1 219 | fi 220 | echo "Getting PMS Server Identifier ok" 221 | 222 | # Get UserToken from plex.tv 223 | echo "Getting User Token from plex.tv" 224 | if ! UserToken=$(GetLoginToken "$uservar" "$passvar" "$XPlexClientIdentifier"); 225 | then 226 | echo "******** ERROR ********" 227 | echo "We failed to authenticate towards plex.tv" 228 | echo "Please check username and password, as well as network access" 229 | exit 1 230 | fi 231 | echo "Getting User Token from plex.tv ok" 232 | 233 | # Get the Claim token 234 | echo "Getting PMS Claim Token" 235 | if ! XPlexClaimtoken=$(GetClaimToken "$UserToken" "$XPlexClientIdentifier"); 236 | then 237 | echo "******** ERROR ********" 238 | echo "We failed to get a claim token from plex.tv" 239 | echo "Please check username and password, as well as network access" 240 | exit 1 241 | fi 242 | echo "Getting PMS Claim Token ok" 243 | 244 | # Claiming server 245 | echo "Claiming server" 246 | Claimit "$ippms" "$XPlexClaimtoken" "$XPlexClientIdentifier" "$UserToken" 247 | -------------------------------------------------------------------------------- /Windows/ClaimIt/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ClaimIt 2 | { 3 | partial class Form1 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.lbAbout = new System.Windows.Forms.ListBox(); 32 | this.llSourceCode = new System.Windows.Forms.LinkLabel(); 33 | this.llLicense = new System.Windows.Forms.LinkLabel(); 34 | this.llDownload = new System.Windows.Forms.LinkLabel(); 35 | this.panel1 = new System.Windows.Forms.Panel(); 36 | this.LWStatus = new System.Windows.Forms.ListView(); 37 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 38 | this.mtbIPAddress = new System.Windows.Forms.MaskedTextBox(); 39 | this.lblStatus = new System.Windows.Forms.Label(); 40 | this.btnClaimIt = new System.Windows.Forms.Button(); 41 | this.lblPMSIP = new System.Windows.Forms.Label(); 42 | this.tbPlexTvPassword2 = new System.Windows.Forms.TextBox(); 43 | this.lblPlexTVPassword2 = new System.Windows.Forms.Label(); 44 | this.tbPlexTvPassword = new System.Windows.Forms.TextBox(); 45 | this.tbPlexTVName = new System.Windows.Forms.TextBox(); 46 | this.lblPlexTVPassword = new System.Windows.Forms.Label(); 47 | this.lblPlexTvLoginName = new System.Windows.Forms.Label(); 48 | this.panel1.SuspendLayout(); 49 | this.SuspendLayout(); 50 | // 51 | // lbAbout 52 | // 53 | this.lbAbout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 54 | | System.Windows.Forms.AnchorStyles.Right))); 55 | this.lbAbout.FormattingEnabled = true; 56 | this.lbAbout.ItemHeight = 16; 57 | this.lbAbout.Items.AddRange(new object[] { 58 | "Welcome to ClaimIt", 59 | "This will hopefully assist you in Claiming a Plex Media Server, in case the offic" + 60 | "ial methods doesn\'t work", 61 | " ", 62 | "Note that this is a free utillity, so if you paid for it, you where scammed!", 63 | "If this utillity was NOT dowloaded from the GitHub link below, then please abort " + 64 | "this, and then downlowd from the link below!", 65 | " ", 66 | "This Utillity will ask you for your plex.tv credentials, which might a concern fo" + 67 | "r a you, but we need it to authenticate towards plex.tv", 68 | " ", 69 | "If you wants to check out the sourcecode, then please review the sourcecode at th" + 70 | "e link provided below", 71 | " ", 72 | "Claimit was made by:", 73 | "* dane22, a Plex community member\n", 74 | "* Mark Walker/ZiGGiMoN, a Plex hobbyist"}); 75 | this.lbAbout.Location = new System.Drawing.Point(12, 12); 76 | this.lbAbout.Name = "lbAbout"; 77 | this.lbAbout.Size = new System.Drawing.Size(982, 132); 78 | this.lbAbout.TabIndex = 1; 79 | this.lbAbout.TabStop = false; 80 | // 81 | // llSourceCode 82 | // 83 | this.llSourceCode.AutoSize = true; 84 | this.llSourceCode.Location = new System.Drawing.Point(12, 150); 85 | this.llSourceCode.Name = "llSourceCode"; 86 | this.llSourceCode.Size = new System.Drawing.Size(86, 17); 87 | this.llSourceCode.TabIndex = 2; 88 | this.llSourceCode.TabStop = true; 89 | this.llSourceCode.Text = "SourceCode"; 90 | this.llSourceCode.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LlSourceCode_LinkClicked); 91 | // 92 | // llLicense 93 | // 94 | this.llLicense.AutoSize = true; 95 | this.llLicense.Location = new System.Drawing.Point(104, 150); 96 | this.llLicense.Name = "llLicense"; 97 | this.llLicense.Size = new System.Drawing.Size(57, 17); 98 | this.llLicense.TabIndex = 3; 99 | this.llLicense.TabStop = true; 100 | this.llLicense.Text = "License"; 101 | this.llLicense.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LlLicense_LinkClicked); 102 | // 103 | // llDownload 104 | // 105 | this.llDownload.AutoSize = true; 106 | this.llDownload.Location = new System.Drawing.Point(167, 150); 107 | this.llDownload.Name = "llDownload"; 108 | this.llDownload.Size = new System.Drawing.Size(70, 17); 109 | this.llDownload.TabIndex = 4; 110 | this.llDownload.TabStop = true; 111 | this.llDownload.Text = "Download"; 112 | this.llDownload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LlDownload_LinkClicked); 113 | // 114 | // panel1 115 | // 116 | this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 117 | | System.Windows.Forms.AnchorStyles.Right))); 118 | this.panel1.Controls.Add(this.LWStatus); 119 | this.panel1.Controls.Add(this.mtbIPAddress); 120 | this.panel1.Controls.Add(this.lblStatus); 121 | this.panel1.Controls.Add(this.btnClaimIt); 122 | this.panel1.Controls.Add(this.lblPMSIP); 123 | this.panel1.Controls.Add(this.tbPlexTvPassword2); 124 | this.panel1.Controls.Add(this.lblPlexTVPassword2); 125 | this.panel1.Controls.Add(this.tbPlexTvPassword); 126 | this.panel1.Controls.Add(this.tbPlexTVName); 127 | this.panel1.Controls.Add(this.lblPlexTVPassword); 128 | this.panel1.Controls.Add(this.lblPlexTvLoginName); 129 | this.panel1.Location = new System.Drawing.Point(15, 188); 130 | this.panel1.Name = "panel1"; 131 | this.panel1.Size = new System.Drawing.Size(979, 351); 132 | this.panel1.TabIndex = 5; 133 | // 134 | // LWStatus 135 | // 136 | this.LWStatus.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 137 | this.columnHeader1}); 138 | this.LWStatus.LabelWrap = false; 139 | this.LWStatus.Location = new System.Drawing.Point(398, 46); 140 | this.LWStatus.Name = "LWStatus"; 141 | this.LWStatus.Size = new System.Drawing.Size(547, 244); 142 | this.LWStatus.TabIndex = 12; 143 | this.LWStatus.TabStop = false; 144 | this.LWStatus.UseCompatibleStateImageBehavior = false; 145 | this.LWStatus.View = System.Windows.Forms.View.Details; 146 | // 147 | // columnHeader1 148 | // 149 | this.columnHeader1.Text = ""; 150 | this.columnHeader1.Width = 900; 151 | // 152 | // mtbIPAddress 153 | // 154 | this.mtbIPAddress.Location = new System.Drawing.Point(21, 268); 155 | this.mtbIPAddress.Mask = "###.###.###.###"; 156 | this.mtbIPAddress.Name = "mtbIPAddress"; 157 | this.mtbIPAddress.Size = new System.Drawing.Size(113, 22); 158 | this.mtbIPAddress.TabIndex = 4; 159 | // 160 | // lblStatus 161 | // 162 | this.lblStatus.AutoSize = true; 163 | this.lblStatus.Location = new System.Drawing.Point(395, 17); 164 | this.lblStatus.Name = "lblStatus"; 165 | this.lblStatus.Size = new System.Drawing.Size(52, 17); 166 | this.lblStatus.TabIndex = 10; 167 | this.lblStatus.Text = "Status:"; 168 | // 169 | // btnClaimIt 170 | // 171 | this.btnClaimIt.Location = new System.Drawing.Point(21, 311); 172 | this.btnClaimIt.Name = "btnClaimIt"; 173 | this.btnClaimIt.Size = new System.Drawing.Size(75, 23); 174 | this.btnClaimIt.TabIndex = 5; 175 | this.btnClaimIt.Text = "&ClaimIt"; 176 | this.btnClaimIt.UseVisualStyleBackColor = true; 177 | this.btnClaimIt.Click += new System.EventHandler(this.BtnClaimIt_Click); 178 | // 179 | // lblPMSIP 180 | // 181 | this.lblPMSIP.AutoSize = true; 182 | this.lblPMSIP.Location = new System.Drawing.Point(18, 228); 183 | this.lblPMSIP.Name = "lblPMSIP"; 184 | this.lblPMSIP.Size = new System.Drawing.Size(246, 17); 185 | this.lblPMSIP.TabIndex = 6; 186 | this.lblPMSIP.Text = "IP Address of your Plex Media Server:"; 187 | // 188 | // tbPlexTvPassword2 189 | // 190 | this.tbPlexTvPassword2.Location = new System.Drawing.Point(21, 185); 191 | this.tbPlexTvPassword2.Name = "tbPlexTvPassword2"; 192 | this.tbPlexTvPassword2.PasswordChar = '*'; 193 | this.tbPlexTvPassword2.Size = new System.Drawing.Size(306, 22); 194 | this.tbPlexTvPassword2.TabIndex = 3; 195 | // 196 | // lblPlexTVPassword2 197 | // 198 | this.lblPlexTVPassword2.AutoSize = true; 199 | this.lblPlexTVPassword2.Location = new System.Drawing.Point(18, 150); 200 | this.lblPlexTVPassword2.Name = "lblPlexTVPassword2"; 201 | this.lblPlexTVPassword2.Size = new System.Drawing.Size(177, 17); 202 | this.lblPlexTVPassword2.TabIndex = 4; 203 | this.lblPlexTVPassword2.Text = "plex.tv password repeated:"; 204 | // 205 | // tbPlexTvPassword 206 | // 207 | this.tbPlexTvPassword.Location = new System.Drawing.Point(21, 116); 208 | this.tbPlexTvPassword.Name = "tbPlexTvPassword"; 209 | this.tbPlexTvPassword.PasswordChar = '*'; 210 | this.tbPlexTvPassword.Size = new System.Drawing.Size(306, 22); 211 | this.tbPlexTvPassword.TabIndex = 2; 212 | // 213 | // tbPlexTVName 214 | // 215 | this.tbPlexTVName.Location = new System.Drawing.Point(21, 46); 216 | this.tbPlexTVName.Name = "tbPlexTVName"; 217 | this.tbPlexTVName.Size = new System.Drawing.Size(306, 22); 218 | this.tbPlexTVName.TabIndex = 1; 219 | // 220 | // lblPlexTVPassword 221 | // 222 | this.lblPlexTVPassword.AutoSize = true; 223 | this.lblPlexTVPassword.Location = new System.Drawing.Point(18, 83); 224 | this.lblPlexTVPassword.Name = "lblPlexTVPassword"; 225 | this.lblPlexTVPassword.Size = new System.Drawing.Size(116, 17); 226 | this.lblPlexTVPassword.TabIndex = 1; 227 | this.lblPlexTVPassword.Text = "plex.tv password:"; 228 | // 229 | // lblPlexTvLoginName 230 | // 231 | this.lblPlexTvLoginName.AutoSize = true; 232 | this.lblPlexTvLoginName.Location = new System.Drawing.Point(18, 17); 233 | this.lblPlexTvLoginName.Name = "lblPlexTvLoginName"; 234 | this.lblPlexTvLoginName.Size = new System.Drawing.Size(125, 17); 235 | this.lblPlexTvLoginName.TabIndex = 0; 236 | this.lblPlexTvLoginName.Text = "plex.tv login name:"; 237 | // 238 | // Form1 239 | // 240 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 241 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 242 | this.ClientSize = new System.Drawing.Size(1006, 555); 243 | this.Controls.Add(this.panel1); 244 | this.Controls.Add(this.llDownload); 245 | this.Controls.Add(this.llLicense); 246 | this.Controls.Add(this.llSourceCode); 247 | this.Controls.Add(this.lbAbout); 248 | this.Name = "Form1"; 249 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 250 | this.Text = "Form1"; 251 | this.Load += new System.EventHandler(this.Form1_Load); 252 | this.panel1.ResumeLayout(false); 253 | this.panel1.PerformLayout(); 254 | this.ResumeLayout(false); 255 | this.PerformLayout(); 256 | 257 | } 258 | 259 | #endregion 260 | private System.Windows.Forms.ListBox lbAbout; 261 | private System.Windows.Forms.LinkLabel llSourceCode; 262 | private System.Windows.Forms.LinkLabel llLicense; 263 | private System.Windows.Forms.LinkLabel llDownload; 264 | private System.Windows.Forms.Panel panel1; 265 | private System.Windows.Forms.TextBox tbPlexTvPassword; 266 | private System.Windows.Forms.TextBox tbPlexTVName; 267 | private System.Windows.Forms.Label lblPlexTVPassword; 268 | private System.Windows.Forms.Label lblPlexTvLoginName; 269 | private System.Windows.Forms.TextBox tbPlexTvPassword2; 270 | private System.Windows.Forms.Label lblPlexTVPassword2; 271 | private System.Windows.Forms.Button btnClaimIt; 272 | private System.Windows.Forms.Label lblPMSIP; 273 | private System.Windows.Forms.Label lblStatus; 274 | private System.Windows.Forms.MaskedTextBox mtbIPAddress; 275 | private System.Windows.Forms.ListView LWStatus; 276 | private System.Windows.Forms.ColumnHeader columnHeader1; 277 | } 278 | } -------------------------------------------------------------------------------- /Windows/ClaimIt/Form1.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.Windows.Forms; 9 | 10 | using System.Net; 11 | using System.Xml; 12 | 13 | 14 | 15 | namespace ClaimIt 16 | { 17 | public partial class Form1 : Form 18 | { 19 | 20 | #region Parameters 21 | 22 | private string PMSID { get; set; } 23 | private string PMSUsr { get; set; } 24 | private string PMSPwd { get; set; } 25 | private string PMSUsrToken { get; set; } 26 | private string PMSClaimItToken { get; set; } 27 | private string PMSIPAddr { get; set; } 28 | 29 | #endregion 30 | 31 | public Form1() 32 | { 33 | InitializeComponent(); 34 | // Hide column headers 35 | LWStatus.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; 36 | } 37 | 38 | private void LlSourceCode_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 39 | { 40 | try 41 | { 42 | VisitClaimIt(); 43 | } 44 | catch (Exception) 45 | { 46 | UpdateStatus("Unable to open link to Github: https://github.com/ukdtom/ClaimIt ", Color.Red); 47 | } 48 | } 49 | 50 | private void VisitClaimIt() 51 | { 52 | // Change the color of the link text by setting LinkVisited 53 | // to true. 54 | llSourceCode.LinkVisited = true; 55 | //Call the Process.Start method to open the default browser 56 | //with a URL: 57 | System.Diagnostics.Process.Start("https://github.com/ukdtom/ClaimIt"); 58 | } 59 | 60 | private void VisitLicense() 61 | { 62 | // Change the color of the link text by setting LinkVisited 63 | // to true. 64 | llLicense.LinkVisited = true; 65 | //Call the Process.Start method to open the default browser 66 | //with a URL: 67 | System.Diagnostics.Process.Start("https://github.com/ukdtom/ClaimIt/blob/master/LICENSE"); 68 | } 69 | 70 | private void VisitDownload() 71 | { 72 | // Change the color of the link text by setting LinkVisited 73 | // to true. 74 | llDownload.LinkVisited = true; 75 | //Call the Process.Start method to open the default browser 76 | //with a URL: 77 | System.Diagnostics.Process.Start("https://github.com/ukdtom/ClaimIt/releases/latest"); 78 | } 79 | 80 | private void Form1_Load(object sender, EventArgs e) 81 | { 82 | this.Text = Application.ProductName + " Version: " + Application.ProductVersion; 83 | this.mtbIPAddress.ValidatingType = typeof(System.Net.IPAddress); 84 | UpdateStatus("Idle...", Color.Gray); 85 | } 86 | 87 | private void LlLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 88 | { 89 | try 90 | { 91 | VisitLicense(); 92 | } 93 | catch (Exception) 94 | { 95 | UpdateStatus("Unable to open link to Github: https://github.com/ukdtom/ClaimIt/blob/master/LICENSE ", Color.Red); 96 | } 97 | } 98 | 99 | private void LlDownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 100 | { 101 | try 102 | { 103 | VisitDownload(); 104 | } 105 | catch (Exception) 106 | { 107 | UpdateStatus("Unable to open link to Github: https://github.com/ukdtom/ClaimIt/releases/latest", Color.Red); 108 | } 109 | } 110 | 111 | private Boolean ComparePwd() 112 | { 113 | UpdateStatus("Checking entered passwords match", Color.Gray); 114 | if (this.tbPlexTvPassword.Text == this.tbPlexTvPassword2.Text) 115 | { 116 | UpdateStatus("Password checked...OK", Color.Green); 117 | PMSPwd = this.tbPlexTvPassword.Text; 118 | return true; 119 | } 120 | else 121 | { 122 | UpdateStatus("Password checked...ERROR...Passwords entered didn't match", Color.Red); 123 | return false; 124 | } 125 | } 126 | 127 | private ListViewItem LWItem( string ItemText, System.Drawing.Color Color) 128 | { 129 | ListViewItem LWItemEntry = new ListViewItem 130 | { 131 | Text = ItemText, 132 | ForeColor = Color 133 | }; 134 | return LWItemEntry; 135 | } 136 | 137 | private void FatalError() 138 | { 139 | UpdateStatus("FATAL ERROR.....Job Aborted", Color.Red); 140 | } 141 | 142 | private Boolean GetPMSIdentifier() 143 | { 144 | try 145 | { 146 | UpdateStatus("Fetching Identifier from PMS", Color.Gray); 147 | string url = "http://" + PMSIPAddr + ":32400/identity"; 148 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 149 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 150 | if ((int)response.StatusCode == 200) 151 | { 152 | XmlDocument xmlDoc = new XmlDocument(); 153 | xmlDoc.Load(response.GetResponseStream()); 154 | PMSID = xmlDoc.DocumentElement.GetAttribute("machineIdentifier"); 155 | UpdateStatus("Got PMS Identifier as: " + PMSID, Color.Green); 156 | return true; 157 | } 158 | else 159 | { 160 | UpdateStatus("PROBLEM: Getting PMS Identifier.....Job Aborted", Color.Red); 161 | UpdateStatus("http status was: " + response.StatusCode.ToString(), Color.Red); 162 | return false; 163 | } 164 | } 165 | catch (Exception ex) 166 | { 167 | UpdateStatus("PROBLEM: Getting PMS Identifier.....Job Aborted", Color.Red); 168 | UpdateStatus("Error was: " + ex.Message, Color.Red); 169 | return false; 170 | } 171 | } 172 | 173 | private Boolean GetUserToken() 174 | { 175 | try 176 | { 177 | string url = string.Format("https://plex.tv/api/v2/users/signin?login={0}&password={1}&X-Plex-Client-Identifier=ClaimIt-{2}", PMSUsr, PMSPwd, PMSID); 178 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 179 | request.Method = "POST"; 180 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 181 | if ((int)response.StatusCode < 300) 182 | { 183 | XmlDocument xmlDoc = new XmlDocument(); 184 | xmlDoc.Load(response.GetResponseStream()); 185 | PMSUsrToken = xmlDoc.DocumentElement.GetAttribute("authToken"); 186 | UpdateStatus("Got plex.tv User Token as: ", Color.Green); 187 | return true; 188 | } 189 | else 190 | { 191 | UpdateStatus("PROBLEM: getting plex.tv Authentication Token.....Job Aborted", Color.Red); 192 | UpdateStatus("http status was: " + response.StatusCode.ToString(), Color.Red); 193 | return false; 194 | } 195 | } 196 | catch (Exception ex) 197 | { 198 | UpdateStatus("PROBLEM: getting plex.tv Authentication Token.....Job Aborted", Color.Red); 199 | UpdateStatus("Error was: " + ex.Message, Color.Red); 200 | return false; 201 | } 202 | } 203 | 204 | private Boolean GetClaimToken() 205 | { 206 | try 207 | { 208 | string url = string.Format("https://plex.tv/api/claim/token?X-Plex-Token={0}&X-Plex-Client-Identifier=ClaimIt-{1}", PMSUsrToken, PMSID); 209 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 210 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 211 | if ((int)response.StatusCode == 200) 212 | { 213 | XmlDocument xmlDoc = new XmlDocument(); 214 | xmlDoc.Load(response.GetResponseStream()); 215 | PMSClaimItToken = xmlDoc.DocumentElement.GetAttribute("token"); 216 | UpdateStatus("Got Claim Token as: " + PMSClaimItToken, Color.Green); 217 | return true; 218 | } 219 | else 220 | { 221 | UpdateStatus("PROBLEM: getting plex.tv Claim Token.....Job Aborted", Color.Red); 222 | UpdateStatus("http status was: " + response.StatusCode.ToString(), Color.Red); 223 | return false; 224 | } 225 | } 226 | catch (Exception ex) 227 | { 228 | UpdateStatus("PROBLEM: Getting PMS Claim Token.....Job Aborted", Color.Red); 229 | UpdateStatus("Error was: " + ex.Message, Color.Red); 230 | return false; 231 | } 232 | } 233 | 234 | private Boolean ClaimIt() 235 | { 236 | try 237 | { 238 | string url = string.Format("http://{0}:32400/myplex/claim?token={1}&X-Plex-Client-Identifier=ClaimIt-{2}&X-Plex-Token={3}", PMSIPAddr, PMSClaimItToken, PMSID, PMSUsrToken); 239 | 240 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 241 | request.Method = "POST"; 242 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 243 | if ((int)response.StatusCode == 200) 244 | { 245 | return true; 246 | } 247 | else 248 | { 249 | UpdateStatus("PROBLEM: Can't claim PMS.....Job Aborted", Color.Red); 250 | UpdateStatus("http status was: " + response.StatusCode.ToString(), Color.Red); 251 | return false; 252 | } 253 | } 254 | catch (Exception ex) 255 | { 256 | UpdateStatus("PROBLEM: Can't Claim PMS.....Job Aborted", Color.Red); 257 | UpdateStatus("Error was: " + ex.Message, Color.Red); 258 | UpdateStatus("Please see: https://github.com/ukdtom/ClaimIt/wiki/Error-Codes", Color.Red); 259 | return false; 260 | } 261 | } 262 | 263 | private void UpdateStatus(string status, Color color) 264 | { 265 | // Add item with correct color 266 | this.LWStatus.Items.Add(LWItem(status, color)); 267 | // Make sure it's visible 268 | LWStatus.Items[LWStatus.Items.Count - 1].EnsureVisible(); 269 | } 270 | 271 | /// 272 | /// Checks if an IP V4 Address is in private address space 273 | /// 274 | /// 275 | /// True if in private address space, else False 276 | private bool _IsPrivate(string ipAddress) 277 | { 278 | int[] ipParts = ipAddress.Split(new String[] { "." }, StringSplitOptions.RemoveEmptyEntries) 279 | .Select(s => int.Parse(s)).ToArray(); 280 | // in private ip range 281 | if (ipParts[0] == 10 || 282 | (ipParts[0] == 192 && ipParts[1] == 168) || 283 | (ipParts[0] == 172 && (ipParts[1] >= 16 && ipParts[1] <= 31))) 284 | { 285 | return true; 286 | } 287 | 288 | // IP Address is probably public. 289 | // This doesn't catch some VPN ranges like OpenVPN and Hamachi. 290 | return false; 291 | } 292 | 293 | private void BtnClaimIt_Click(object sender, EventArgs e) 294 | { 295 | Cursor.Current = Cursors.WaitCursor; 296 | PMSUsr = this.tbPlexTVName.Text; 297 | PMSPwd = this.tbPlexTvPassword.Text; 298 | PMSIPAddr = mtbIPAddress.Text.Replace(" ", ""); 299 | // Check if address is either loopback or Private 300 | if (!((PMSIPAddr == "127.0.0.1") || _IsPrivate(PMSIPAddr))) 301 | { 302 | UpdateStatus("The IP address entered is not in Private Address Space", Color.Red); 303 | UpdateStatus("Please see: https://github.com/ukdtom/ClaimIt/wiki/IP-Address-requirement", Color.Red); 304 | FatalError(); 305 | } 306 | else 307 | { 308 | // Get IP of PC running this 309 | IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName()); 310 | foreach (var IP in localIPs) 311 | { 312 | this.LWStatus.Items.Add(LWItem("This app is running on IP: " + IP.ToString(), Color.Gray)); 313 | } 314 | UpdateStatus("PMS IP: " + PMSIPAddr, Color.Gray); 315 | UpdateStatus("Starting to work...", Color.Gray); 316 | if (ComparePwd()) 317 | { 318 | if (GetPMSIdentifier()) 319 | { 320 | if (GetUserToken()) 321 | { 322 | if (GetClaimToken()) 323 | { 324 | if (ClaimIt()) 325 | { 326 | UpdateStatus("All Done", Color.Green); 327 | UpdateStatus(string.Format("Please close your browser, reopen, and browse to http://{0}:32400/web", PMSIPAddr), Color.Green); 328 | } 329 | else 330 | { 331 | FatalError(); 332 | } 333 | } 334 | else 335 | { 336 | FatalError(); 337 | } 338 | } 339 | else 340 | { 341 | FatalError(); 342 | } 343 | } 344 | else 345 | { 346 | FatalError(); 347 | } 348 | } 349 | else 350 | { 351 | FatalError(); 352 | } 353 | Cursor.Current = Cursors.Default; 354 | } 355 | } 356 | } 357 | } 358 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | --------------------------------------------------------------------------------