File tree Expand file tree Collapse file tree
src/main/kotlin/com/dubbindo Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050 working-directory : ${{ github.workspace }}/src
5151 env :
5252 DUBBINDO_PASSWORD : ${{ secrets.DUBBINDO_PASS }}
53+ DUBBINDO_USERNAME : ${{ secrets.DUBBINDO_USER }}
5354 run : |
5455 chmod +x gradlew
5556 ./gradlew make makePluginsJson
Original file line number Diff line number Diff line change @@ -37,5 +37,8 @@ android {
3737 defaultConfig {
3838 val githubPassword = System .getenv(" DUBBINDO_PASSWORD" ) ? : " "
3939 buildConfigField(" String" , " DUBBINDO_PASSWORD" , " \" $githubPassword \" " )
40+
41+ val githubUsername = System .getenv(" DUBBINDO_USERNAME" ) ? : " "
42+ buildConfigField(" String" , " DUBBINDO_USERNAME" , " \" $githubUsername \" " )
4043 }
4144}
Original file line number Diff line number Diff line change @@ -26,11 +26,13 @@ class DubbindoProvider : MainAPI() {
2626 TvType .Anime ,
2727 )
2828
29- private val USERNAME = " HatsuneMikuUwU "
29+ private val USERNAME = BuildConfig . DUBBINDO_USERNAME
3030 private val PASSWORD = BuildConfig .DUBBINDO_PASSWORD
3131
3232 private var sessionCookie = " "
3333
34+ private val subscribedChannelIds = mutableSetOf<String >()
35+
3436 private val baseHeaders get() = mapOf (
3537 " User-Agent" to " Mozilla/5.0 (Linux; Android 10; Mobile) AppleWebKit/537.36 Chrome/124.0 Mobile Safari/537.36" ,
3638 " Referer" to " $mainUrl /"
@@ -100,6 +102,8 @@ class DubbindoProvider : MainAPI() {
100102
101103 if (channelId.isBlank()) return false
102104
105+ if (channelId in subscribedChannelIds) return true
106+
103107 val mainSession = document
104108 .selectFirst(" input.main_session" )?.attr(" value" )?.trim()
105109 .orEmpty()
@@ -122,6 +126,8 @@ class DubbindoProvider : MainAPI() {
122126
123127 if (! resp.isSuccessful) return false
124128
129+ subscribedChannelIds.add(channelId)
130+
125131 val muteUrl = if (mainSession.isNotBlank())
126132 " $mainUrl /aj/user/notify?hash=$mainSession "
127133 else
You can’t perform that action at this time.
0 commit comments