add support for some peertube instances

The one used for tests, popular instances and user wanted (e.g. la quadrature du net, video.lqdn.fr, or @TheAssassin instance, media-assassinate-you.net)
This commit is contained in:
bopol 2020-04-11 20:35:04 +02:00
parent b3eadb557b
commit 929d13bfea
2 changed files with 173 additions and 141 deletions

View File

@ -158,7 +158,7 @@ dependencies {
exclude module: 'support-annotations' exclude module: 'support-annotations'
}) })
implementation 'com.github.TeamNewPipe:NewPipeExtractor:f3913e241e379adf0091319091e8f895c5fcfd07' implementation 'com.github.B0pol:NewPipeExtractor:7cae95bf09ddc59ec77b3a905a23278318ef15f7'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0' testImplementation 'org.mockito:mockito-core:2.23.0'

View File

@ -1,22 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="org.schabi.newpipe"> package="org.schabi.newpipe">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/> <uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<application <application
android:banner="@mipmap/newpipe_tv_banner"
android:name=".App" android:name=".App"
android:allowBackup="true" android:allowBackup="true"
android:banner="@mipmap/newpipe_tv_banner"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:logo="@mipmap/ic_launcher" android:logo="@mipmap/ic_launcher"
@ -27,13 +28,14 @@
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<receiver android:name="androidx.media.session.MediaButtonReceiver" > <receiver android:name="androidx.media.session.MediaButtonReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter> </intent-filter>
@ -49,36 +51,36 @@
<activity <activity
android:name=".player.BackgroundPlayerActivity" android:name=".player.BackgroundPlayerActivity"
android:launchMode="singleTask" android:label="@string/title_activity_background_player"
android:label="@string/title_activity_background_player"/> android:launchMode="singleTask" />
<activity <activity
android:name=".player.PopupVideoPlayerActivity" android:name=".player.PopupVideoPlayerActivity"
android:launchMode="singleTask" android:label="@string/title_activity_popup_player"
android:label="@string/title_activity_popup_player"/> android:launchMode="singleTask" />
<service <service
android:name=".player.PopupVideoPlayer" android:name=".player.PopupVideoPlayer"
android:exported="false"/> android:exported="false" />
<activity <activity
android:name=".player.MainVideoPlayer" android:name=".player.MainVideoPlayer"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@style/VideoPlayerTheme"/> android:theme="@style/VideoPlayerTheme" />
<activity <activity
android:name=".settings.SettingsActivity" android:name=".settings.SettingsActivity"
android:label="@string/settings"/> android:label="@string/settings" />
<activity <activity
android:name=".about.AboutActivity" android:name=".about.AboutActivity"
android:label="@string/title_activity_about"/> android:label="@string/title_activity_about" />
<service android:name=".local.subscription.services.SubscriptionsImportService"/> <service android:name=".local.subscription.services.SubscriptionsImportService" />
<service android:name=".local.subscription.services.SubscriptionsExportService"/> <service android:name=".local.subscription.services.SubscriptionsExportService" />
<service android:name=".local.feed.service.FeedLoadService"/> <service android:name=".local.feed.service.FeedLoadService" />
<activity <activity
android:name=".PanicResponderActivity" android:name=".PanicResponderActivity"
@ -86,25 +88,25 @@
android:noHistory="true" android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay"> android:theme="@android:style/Theme.NoDisplay">
<intent-filter> <intent-filter>
<action android:name="info.guardianproject.panic.action.TRIGGER"/> <action android:name="info.guardianproject.panic.action.TRIGGER" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ExitActivity" android:name=".ExitActivity"
android:label="@string/general_error" android:label="@string/general_error"
android:theme="@android:style/Theme.NoDisplay"/> android:theme="@android:style/Theme.NoDisplay" />
<activity android:name=".report.ErrorActivity"/> <activity android:name=".report.ErrorActivity" />
<!-- giga get related --> <!-- giga get related -->
<activity <activity
android:name=".download.DownloadActivity" android:name=".download.DownloadActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask"/> android:launchMode="singleTask" />
<service android:name="us.shandian.giga.service.DownloadManagerService"/> <service android:name="us.shandian.giga.service.DownloadManagerService" />
<activity <activity
android:name=".util.FilePickerActivityHelper" android:name=".util.FilePickerActivityHelper"
@ -118,7 +120,7 @@
<activity <activity
android:name=".ReCaptchaActivity" android:name=".ReCaptchaActivity"
android:label="@string/recaptcha"/> android:label="@string/recaptcha" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
@ -127,7 +129,7 @@
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths"/> android:resource="@xml/nnf_provider_paths" />
</provider> </provider>
<activity <activity
@ -139,165 +141,195 @@
<!-- Youtube filter --> <!-- Youtube filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="youtube.com"/> <data android:host="youtube.com" />
<data android:host="m.youtube.com"/> <data android:host="m.youtube.com" />
<data android:host="www.youtube.com"/> <data android:host="www.youtube.com" />
<data android:host="music.youtube.com"/> <data android:host="music.youtube.com" />
<!-- video prefix --> <!-- video prefix -->
<data android:pathPrefix="/v/"/> <data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/"/> <data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch"/> <data android:pathPrefix="/watch" />
<data android:pathPrefix="/attribution_link"/> <data android:pathPrefix="/attribution_link" />
<!-- channel prefix --> <!-- channel prefix -->
<data android:pathPrefix="/channel/"/> <data android:pathPrefix="/channel/" />
<data android:pathPrefix="/user/"/> <data android:pathPrefix="/user/" />
<data android:pathPrefix="/c/"/> <data android:pathPrefix="/c/" />
<!-- playlist prefix --> <!-- playlist prefix -->
<data android:pathPrefix="/playlist"/> <data android:pathPrefix="/playlist" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="youtu.be"/> <data android:host="youtu.be" />
<data android:pathPrefix="/"/> <data android:pathPrefix="/" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="www.youtube-nocookie.com"/> <data android:host="www.youtube-nocookie.com" />
<data android:pathPrefix="/embed/"/> <data android:pathPrefix="/embed/" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="vnd.youtube"/> <data android:scheme="vnd.youtube" />
<data android:scheme="vnd.youtube.launch"/> <data android:scheme="vnd.youtube.launch" />
</intent-filter> </intent-filter>
<!-- Hooktube filter --> <!-- Hooktube filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="hooktube.com"/> <data android:host="hooktube.com" />
<data android:host="*.hooktube.com"/> <data android:host="*.hooktube.com" />
<!-- video prefix --> <!-- video prefix -->
<data android:pathPrefix="/v/"/> <data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/"/> <data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch"/> <data android:pathPrefix="/watch" />
<!-- channel prefix --> <!-- channel prefix -->
<data android:pathPrefix="/channel/"/> <data android:pathPrefix="/channel/" />
<data android:pathPrefix="/user/"/> <data android:pathPrefix="/user/" />
</intent-filter> </intent-filter>
<!-- Invidious filter --> <!-- Invidious filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="invidio.us"/> <data android:host="invidio.us" />
<data android:host="dev.invidio.us"/> <data android:host="dev.invidio.us" />
<data android:host="www.invidio.us"/> <data android:host="www.invidio.us" />
<data android:host="invidious.snopyta.org"/> <data android:host="invidious.snopyta.org" />
<data android:host="de.invidious.snopyta.org"/> <data android:host="de.invidious.snopyta.org" />
<data android:host="fi.invidious.snopyta.org"/> <data android:host="fi.invidious.snopyta.org" />
<data android:host="vid.wxzm.sx"/> <data android:host="vid.wxzm.sx" />
<data android:host="invidious.kabi.tk"/> <data android:host="invidious.kabi.tk" />
<data android:host="invidiou.sh"/> <data android:host="invidiou.sh" />
<data android:host="www.invidiou.sh"/> <data android:host="www.invidiou.sh" />
<data android:host="no.invidiou.sh"/> <data android:host="no.invidiou.sh" />
<data android:host="invidious.enkirton.net"/> <data android:host="invidious.enkirton.net" />
<data android:host="tube.poal.co"/> <data android:host="tube.poal.co" />
<data android:host="invidious.13ad.de"/> <data android:host="invidious.13ad.de" />
<data android:host="yt.elukerio.org"/> <data android:host="yt.elukerio.org" />
<data android:pathPrefix="/"/> <data android:pathPrefix="/" />
</intent-filter> </intent-filter>
<!-- Soundcloud filter --> <!-- Soundcloud filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="soundcloud.com"/> <data android:host="soundcloud.com" />
<data android:host="m.soundcloud.com"/> <data android:host="m.soundcloud.com" />
<data android:host="www.soundcloud.com"/> <data android:host="www.soundcloud.com" />
<data android:pathPrefix="/"/> <data android:pathPrefix="/" />
</intent-filter> </intent-filter>
<!-- Share filter --> <!-- Share filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND"/> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"/> <data android:mimeType="text/plain" />
</intent-filter> </intent-filter>
<!-- MediaCCC filter --> <!-- MediaCCC filter -->
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/> <data android:scheme="http" />
<data android:scheme="https"/> <data android:scheme="https" />
<data android:host="media.ccc.de"/> <data android:host="media.ccc.de" />
<!-- video prefix --> <!-- video prefix -->
<data android:pathPrefix="/v/"/> <data android:pathPrefix="/v/" />
<!-- channel prefix--> <!-- channel prefix-->
<data android:pathPrefix="/c/"/> <data android:pathPrefix="/c/" />
<data android:pathPrefix="/b/"/> <data android:pathPrefix="/b/" />
</intent-filter>
<!-- PeerTube filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="framatube.org" />
<data android:host="media.assassinate-you.net" />
<data android:host="peertube.co.uk" />
<data android:host="peertube.cpy.re" />
<data android:host="peertube.mastodon.host" />
<data android:host="peertube.fr" />
<data android:host="peertube.live" />
<data android:host="peertube.video" />
<data android:host="video.ploud.fr" />
<data android:host="video.lqdn.fr" />
<data android:host="skeptikon.fr" />
<data android:pathPrefix="/accounts/" />
<data android:pathPrefix="/playlist/" />
<data android:pathPrefix="/videos/" />
<data android:pathPrefix="/video-channels/" />
</intent-filter> </intent-filter>
</activity> </activity>
<service <service
android:name=".RouterActivity$FetcherService" android:name=".RouterActivity$FetcherService"
android:exported="false"/> android:exported="false" />
</application> </application>
</manifest> </manifest>