Skip to content

Commit

Permalink
Merge pull request #230 from Max1Don/main
Browse files Browse the repository at this point in the history
fix(extractors): update VOE and upgrade dependencies
  • Loading branch information
stantanasi authored Nov 25, 2024
2 parents a2911aa + a66b180 commit d546bc6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
.externalNativeBuild
.cxx
local.properties
*.salive
*.log
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.8.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.8.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.8.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.8.4'
implementation project(path: ':navigation')

implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.leanback:leanback:1.0.0'
implementation 'androidx.leanback:leanback:1.2.0-alpha04'
implementation 'com.github.bumptech.glide:glide:5.0.0-rc01'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'

Expand All @@ -86,10 +86,10 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.12.0'
implementation 'dnsjava:dnsjava:3.5.3'
implementation 'dnsjava:dnsjava:3.6.2'
implementation project(path: ':retrofit-jsoup-converter')
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
implementation 'org.jsoup:jsoup:1.17.2'
implementation 'org.jsoup:jsoup:1.18.1'

implementation 'androidx.fragment:fragment-ktx:1.8.5'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.7'
Expand Down
25 changes: 18 additions & 7 deletions app/src/main/java/com/tanasi/streamflix/extractors/VoeExtractor.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tanasi.streamflix.extractors

import android.util.Base64
import com.tanasi.retrofit_jsoup.converter.JsoupConverterFactory
import com.tanasi.streamflix.models.Video
import org.jsoup.nodes.Document
Expand All @@ -13,11 +14,12 @@ class VoeExtractor : Extractor() {
override val mainUrl = "https://voe.sx/"

override suspend fun extract(link: String): Video {
val service = VoeExtractorService.build(mainUrl)
val service = VoeExtractorService.build(mainUrl, link)
val source = service.getSource(link.replace(mainUrl, ""))
val hlsUrl = source.html().split("'hls': '")[1].split("',")[0]
val hlsUrlEncoded = source.html().split("'hls': '")[1].split("',")[0]
val hlsUrlDecoded = Base64.decode(hlsUrlEncoded, Base64.NO_WRAP).toString(Charsets.UTF_8)
return Video(
source = hlsUrl,
source = hlsUrlDecoded,
subtitles = listOf()
)
}
Expand All @@ -26,13 +28,22 @@ class VoeExtractor : Extractor() {
private interface VoeExtractorService {

companion object {
fun build(baseUrl: String): VoeExtractorService {
val retrofit = Retrofit.Builder()
suspend fun build(baseUrl: String, originalLink: String): VoeExtractorService {
val retrofitVOE = Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(JsoupConverterFactory.create())
.build()

return retrofit.create(VoeExtractorService::class.java)
val retrofitVOEBuiled = retrofitVOE.create(VoeExtractorService::class.java)

val retrofitVOEhtml =
retrofitVOEBuiled.getSource(originalLink.replace(baseUrl, "")).html()
val redirectBaseUrl =
"https://" + retrofitVOEhtml.split("https://")[1].split("e/")[0]
val retrofitRedirected = Retrofit.Builder()
.baseUrl(redirectBaseUrl)
.addConverterFactory(JsoupConverterFactory.create())
.build()
return retrofitRedirected.create(VoeExtractorService::class.java)
}
}

Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.9.23'
ext.kotlin_version = '2.0.21'

repositories {
google()
}
dependencies {
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.8.4'
}
}

plugins {
id 'com.android.application' version '8.6.1' apply false
id 'com.android.library' version '8.6.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
id 'com.google.devtools.ksp' version '1.9.23-1.0.20' apply false
id 'com.android.application' version '8.7.2' apply false
id 'com.android.library' version '8.7.2' apply false
id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
id 'com.google.devtools.ksp' version '2.0.21-1.0.28' apply false
}

task clean(type: Delete) {
Expand Down
8 changes: 4 additions & 4 deletions navigation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {

android {
namespace 'com.tanasi.navigation'
compileSdk 34
compileSdk 35

defaultConfig {
minSdk 21
targetSdk 34
targetSdk 35

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -32,12 +32,12 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'

implementation 'androidx.navigation:navigation-ui-ktx:2.8.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.8.4'
}
8 changes: 4 additions & 4 deletions retrofit-jsoup-converter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {

android {
namespace 'com.tanasi.retrofit_jsoup'
compileSdk 34
compileSdk 35

defaultConfig {
minSdk 21
targetSdk 34
targetSdk 35

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -32,7 +32,7 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
testImplementation 'junit:junit:4.13.2'
Expand All @@ -41,5 +41,5 @@ dependencies {

implementation 'com.squareup.retrofit2:retrofit:2.11.0'

implementation 'org.jsoup:jsoup:1.17.2'
implementation 'org.jsoup:jsoup:1.18.1'
}

0 comments on commit d546bc6

Please sign in to comment.