Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rumble
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoStreaming
Plugins
Rumble
Compare revisions
6811ff4b412cfb94ff74c3b2b88f7d87b76e8902 to 670cbc043e8901026c43e1a2e4ac44e12e32143b
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
videostreaming/plugins/rumble
Select target project
No results found
670cbc043e8901026c43e1a2e4ac44e12e32143b
Select Git revision
Branches
master
Swap
Target
videostreaming/plugins/rumble
Select target project
videostreaming/plugins/rumble
1 result
6811ff4b412cfb94ff74c3b2b88f7d87b76e8902
Select Git revision
Branches
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Support premium content
· 670cbc04
Kai DeLorenzo
authored
1 month ago
Changelog: added
670cbc04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RumbleConfig.json
+1
-1
1 addition, 1 deletion
RumbleConfig.json
RumbleScript.js
+30
-8
30 additions, 8 deletions
RumbleScript.js
with
31 additions
and
9 deletions
RumbleConfig.json
View file @
670cbc04
...
...
@@ -8,7 +8,7 @@
"sourceUrl"
:
"https://plugins.grayjay.app/Rumble/RumbleConfig.json"
,
"repositoryUrl"
:
"https://futo.org"
,
"scriptUrl"
:
"./RumbleScript.js"
,
"version"
:
4
8
,
"version"
:
4
9
,
"iconUrl"
:
"./rumble.png"
,
"id"
:
"2ce7b35e-d2b2-4adb-a728-a34a30d30359"
,
...
...
This diff is collapsed.
Click to expand it.
RumbleScript.js
View file @
670cbc04
...
...
@@ -14,6 +14,7 @@ const REGEX_USER_IMAGE = /user-image--img--id-([0-9a-z]+)/;
const
REGEX_VIDEO_IMAGE_CSS
=
/.video-item--by-a--
([
0-9a-z
]
+
)
::before
\s
*
\{\s
*background-image:
\s
+url
\(
"
?([^
"
\)]
+
)
"
?\)
/g
;
const
REGEX_VIDEO_IMAGE
=
/video-item--by-a--
([
0-9a-z
]
+
)
/
;
const
REGEX_VIDEO_ID
=
/
(?:
https:
\/\/
.+
)?\/([^
-
]
+
)
/
;
const
REGEX_VIDEO_INFO
=
/Rumble
\(
"play",
(
{".*
?)
,"api"/
const
PLATFORM
=
"
Rumble
"
;
const
PLATFORM_CLAIMTYPE
=
4
;
...
...
@@ -234,7 +235,7 @@ source.isContentDetailsUrl = function (url) {
return
url
.
startsWith
(
URL_BASE_VIDEO
);
};
source
.
getContentDetails
=
function
(
url
)
{
const
res
=
http
.
GET
(
url
,
{})
;
const
res
=
http
.
GET
(
url
,
{}
,
true
)
if
(
res
.
code
!==
200
)
{
return
null
;
}
...
...
@@ -253,12 +254,23 @@ source.getContentDetails = function (url) {
}
}
const
vid
=
findVideoId
(
res
.
body
);
const
vidInfo
=
findVideoInfo
(
res
.
body
)
const
vid
=
vidInfo
.
video
if
(
vidInfo
===
null
)
{
if
(
bridge
.
isLoggedIn
())
{
throw
new
LoginRequiredException
(
"
Subscribe to watch premium content
"
)
}
else
{
throw
new
LoginRequiredException
(
"
Login to access premium content
"
)
}
}
if
(
vidInfo
.
show_premium_exclusive_gate
)
{
bridge
.
toast
(
"
Contains premium exclusive section. Subscribe to watch premium content
"
)
}
const
resTracks
=
http
.
GET
(
`
${
URL_VIDEO_DETAIL
}${
buildQuery
({
request
:
"
video
"
,
ver
:
2
,
v
:
vid
})}
`
,
{});
})}
`
,
{}
,
true
);
if
(
resTracks
.
code
!=
200
)
{
return
null
;
...
...
@@ -282,7 +294,7 @@ source.getContentDetails = function (url) {
});
sources
.
push
(
stream
);
if
(
data
.
meta
.
live
&&
isLive
)
{
if
(
isLive
&&
data
.
meta
.
live
)
{
liveStream
=
stream
;
}
}
...
...
@@ -369,7 +381,7 @@ source.getLiveChatWindow = function (url) {
};
source
.
getComments
=
function
(
url
)
{
const
comments
=
[];
const
res
=
http
.
GET
(
url
,
{});
const
res
=
http
.
GET
(
url
,
{}
,
true
);
let
lastCommentPerLevel
=
{};
if
(
res
.
isOk
)
{
const
vid
=
findVideoId
(
res
.
body
).
substring
(
1
);
...
...
@@ -808,14 +820,24 @@ function getVideosPager(url, params, author) {
return
new
VideoPager
([],
false
);
}
/**
* Find the video info in a block of text.
* @param {String} text
*/
function
findVideoInfo
(
text
)
{
const
vidInfoMatch
=
text
.
match
(
REGEX_VIDEO_INFO
)
const
vidInfo
=
vidInfoMatch
?
JSON
.
parse
(
vidInfoMatch
[
1
]
+
"
}
"
)
:
null
return
vidInfo
}
/**
* Find the video id in a block of text.
* @param {String} text
*/
function
findVideoId
(
text
)
{
const
vid
Match
=
text
.
match
(
/Rumble
\(
.*
?\"
video
\"
:
\"(
.*
?)\"
/
);
const
vid
=
vid
Match
?
vid
Match
[
1
]
:
null
;
return
vid
;
const
vid
Info
=
findVideoInfo
(
text
)
const
vid
=
vid
Info
?
vid
Info
.
video
:
null
return
vid
}
/**
...
...
This diff is collapsed.
Click to expand it.