-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
689 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
IINA+/Core Data/DataModel.xcdatamodeld/Bookmark v0.3.xcdatamodel/contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19461" systemVersion="21A559" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier=""> | ||
<entity name="Bookmark" representedClassName=".Bookmark" versionHashModifier="added order" syncable="YES"> | ||
<attribute name="cover" optional="YES" attributeType="String"/> | ||
<attribute name="liveName" optional="YES" attributeType="String" defaultValueString=""/> | ||
<attribute name="liveTitle" optional="YES" attributeType="String" defaultValueString=""/> | ||
<attribute name="order" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/> | ||
<attribute name="remark" optional="YES" attributeType="String"/> | ||
<attribute name="state" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/> | ||
<attribute name="updateDate" optional="YES" attributeType="Date" usesScalarValueType="NO"/> | ||
<attribute name="url" optional="YES" attributeType="String" defaultValueString="https://live.bilibili.com/1010"/> | ||
</entity> | ||
<elements> | ||
<element name="Bookmark" positionX="-103.39453125" positionY="-9" width="177.39453125" height="149"/> | ||
</elements> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// SupportSites.swift | ||
// IINA+ | ||
// | ||
// Created by xjbeta on 11/15/21. | ||
// Copyright © 2021 xjbeta. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
enum SupportSites: String { | ||
case biliLive = "live.bilibili.com" | ||
case bilibili = "www.bilibili.com/video" | ||
case bangumi = "www.bilibili.com/bangumi" | ||
case douyu = "www.douyu.com" | ||
case huya = "www.huya.com" | ||
case quanmin = "www.quanmin.tv" | ||
case longzhu = "star.longzhu.com" | ||
case eGame = "egame.qq.com" | ||
// case yizhibo = "www.yizhibo.com" | ||
case langPlay = "play.lang.live" | ||
case cc163 = "cc.163.com" | ||
case unsupported | ||
|
||
var siteName: String { | ||
switch self { | ||
case .biliLive: | ||
return "Bilibili Live" | ||
case .bilibili: | ||
return "Bilibili" | ||
case .bangumi: | ||
return "Bilibili Bangumi" | ||
case .douyu: | ||
return "Douyu" | ||
case .huya: | ||
return "Huya" | ||
case .quanmin: | ||
return "QuanMin" | ||
case .longzhu: | ||
return "LongZhu" | ||
case .eGame: | ||
return "eGame" | ||
case .langPlay: | ||
return "LangPlay" | ||
case .cc163: | ||
return "CC163" | ||
case .unsupported: | ||
return "Unsupported" | ||
} | ||
} | ||
|
||
init(url: String) { | ||
guard let u = URL(string: url) else { | ||
self = .unsupported | ||
return | ||
} | ||
|
||
let host = u.host ?? "" | ||
if host == "www.bilibili.com", u.pathComponents.count >= 2 { | ||
switch u.pathComponents[1] { | ||
case "video": | ||
self = .bilibili | ||
case "bangumi": | ||
self = .bangumi | ||
default: | ||
self = .unsupported | ||
} | ||
} else if let list = SupportSites(rawValue: host) { | ||
self = list | ||
} else { | ||
self = .unsupported | ||
} | ||
} | ||
} |
Oops, something went wrong.