Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
SaveTube
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sebaro
SaveTube
Commits
2dca28b5
Commit
2dca28b5
authored
Jan 30, 2019
by
sebaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Maxthon addon
parent
57e2fc3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
138 deletions
+12
-138
Extensions/Maxthon/SaveTube.mxaddon
Extensions/Maxthon/SaveTube.mxaddon
+0
-0
Extensions/Maxthon/SaveTube/def.json
Extensions/Maxthon/SaveTube/def.json
+2
-6
Extensions/Maxthon/SaveTube/script.js
Extensions/Maxthon/SaveTube/script.js
+10
-132
No files found.
Extensions/Maxthon/SaveTube.mxaddon
View file @
2dca28b5
No preview for this file type
Extensions/Maxthon/SaveTube/def.json
View file @
2dca28b5
[{
"author"
:
"Sebaro (script) & A.S. (mxaddon)"
,
"website"
:
"http://sebaro.pro/savetube/"
,
"date"
:
"
07.11.2018
"
,
"date"
:
"
18.01.2019
"
,
"type"
:
"extension"
,
"frameworkVersion"
:
"1.0.0"
,
"version"
:
"201
8.11.07.0
"
,
"version"
:
"201
9.01.18.1
"
,
"guid"
:
"{3DEDEE46-63BC-4024-9796-737F8820E16E}"
,
"name"
:
"SaveTube"
,
"icon"
:
"icon"
,
...
...
@@ -23,10 +23,6 @@
"vimeo.com"
,
"*.metacafe.com"
,
"metacafe.com"
,
"*.break.com"
,
"break.com"
,
"*.funnyordie.com"
,
"funnyordie.com"
,
"*.veoh.com"
,
"veoh.com"
,
"*.viki.com"
,
...
...
Extensions/Maxthon/SaveTube/script.js
View file @
2dca28b5
// ==UserScript==
// @name SaveTube
// @version 201
8.11.07
// @version 201
9.01.18
// @description Download videos from video sharing web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
...
...
@@ -27,14 +27,6 @@
// @include http://www.metacafe.com*
// @include https://metacafe.com*
// @include https://www.metacafe.com*
// @include http://break.com*
// @include http://www.break.com*
// @include https://break.com*
// @include https://www.break.com*
// @include http://funnyordie.com*
// @include http://www.funnyordie.com*
// @include https://funnyordie.com*
// @include https://www.funnyordie.com*
// @include http://veoh.com*
// @include http://www.veoh.com*
// @include https://veoh.com*
...
...
@@ -55,7 +47,7 @@
/*
Copyright (C) 2010 - 201
8
Sebastian Luncan
Copyright (C) 2010 - 201
9
Sebastian Luncan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -470,10 +462,11 @@ function getMyVideo() {
function
cleanMyContent
(
content
,
unesc
)
{
var
myNewContent
=
content
;
if
(
unesc
)
myNewContent
=
unescape
(
myNewContent
);
myNewContent
=
myNewContent
.
replace
(
/
\\
u0025/g
,
'
%
'
);
myNewContent
=
myNewContent
.
replace
(
/
\\
u0026/g
,
'
&
'
);
myNewContent
=
myNewContent
.
replace
(
/
\\
/g
,
''
);
myNewContent
=
myNewContent
.
replace
(
/
\n
/g
,
''
);
myNewContent
=
myNewContent
.
replace
(
/
\\
u0025/g
,
'
%
'
);
myNewContent
=
myNewContent
.
replace
(
/
\\
u0026/g
,
'
&
'
);
myNewContent
=
myNewContent
.
replace
(
/
\\
u002F/g
,
'
/
'
);
myNewContent
=
myNewContent
.
replace
(
/
\\
/g
,
''
);
myNewContent
=
myNewContent
.
replace
(
/
\n
/g
,
''
);
return
myNewContent
;
}
...
...
@@ -595,7 +588,7 @@ function SaveTube() {
var
ytSignFuncName
,
ytSignFuncBody
,
ytSwapFuncName
,
ytSwapFuncBody
,
ytFuncMatch
;
ytScriptSrc
=
ytScriptSrc
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
''
);
ytSignFuncName
=
ytScriptSrc
.
match
(
/"signature"
\s
*,
\s
*
([^\)]
*
?)\(
/
);
if
(
!
ytSignFuncName
)
ytSignFuncName
=
ytScriptSrc
.
match
(
/d.set
\(
b,.*
?([
a-zA-Z0-9
]
+
)\(
/
);
if
(
!
ytSignFuncName
)
ytSignFuncName
=
ytScriptSrc
.
match
(
/d.set
\(
b,
(?:
encodeURIComponent
\()?
.*
?([
a-zA-Z0-9
]
+
)\(
/
);
ytSignFuncName
=
(
ytSignFuncName
)
?
ytSignFuncName
[
1
]
:
null
;
if
(
ytSignFuncName
)
{
ytFuncMatch
=
ytSignFuncName
.
replace
(
/
\$
/
,
'
\\
$
'
)
+
'
\\
s*=
\\
s*function
\\
s*
'
+
'
\\
s*
\\
(
\\
w+
\\
)
\\
s*
\\
{(.*?)
\\
}
'
;
...
...
@@ -1082,123 +1075,6 @@ function SaveTube() {
}
// =====Break===== //
else
if
(
page
.
url
.
indexOf
(
'
break.com/video
'
)
!=
-
1
)
{
/* Get Video Title */
var
brVideoTitle
=
getMyContent
(
page
.
url
,
'
meta
\\
s+property="og:title"
\\
s+content="(.*?)"
'
,
false
);
if
(
brVideoTitle
)
{
brVideoTitle
=
brVideoTitle
.
replace
(
/"/g
,
'
\'
'
).
replace
(
/"/g
,
'
\'
'
).
replace
(
/"/g
,
'
\'
'
);
brVideoTitle
=
brVideoTitle
.
replace
(
/'/g
,
'
\'
'
).
replace
(
/'/g
,
'
\'
'
);
brVideoTitle
=
brVideoTitle
.
replace
(
/&/g
,
'
and
'
).
replace
(
/&/g
,
'
and
'
);
brVideoTitle
=
brVideoTitle
.
replace
(
/
\?
/g
,
''
).
replace
(
/
[
#:
\*]
/g
,
'
-
'
).
replace
(
/
\/
/g
,
'
-
'
);
brVideoTitle
=
brVideoTitle
.
replace
(
/^
\s
+|
\s
+$/
,
''
).
replace
(
/
\.
+$/g
,
''
);
brVideoTitle
=
brVideoTitle
.
replace
(
/
\s\|\s
Video
\s\|\s
Break$/
,
''
);
}
/* Get Video */
var
brVideo
=
getMyContent
(
page
.
url
,
'
\\
[
\\
{"url":"(.*?)"
\\
}
\\
]
'
,
false
);
if
(
!
brVideo
)
brVideo
=
getMyContent
(
page
.
url
,
'
youtube.com
\
/embed
\
/(.*?)(
\\
?|&|")
'
,
false
);
/* Get Videos */
if
(
brVideo
)
{
if
(
brVideo
.
length
==
11
)
{
var
ytVideoLink
=
'
http://youtube.com/watch?v=
'
+
brVideo
;
saver
[
'
warnMess
'
]
=
'
embed
'
;
saver
[
'
warnContent
'
]
=
ytVideoLink
;
createMySaver
();
}
else
{
/* Create Player */
var
brDefaultVideo
=
'
Low Definition MP4
'
;
var
brVideoList
=
{};
brVideoList
[
brDefaultVideo
]
=
brVideo
;
saver
=
{
'
videoList
'
:
brVideoList
,
'
videoSave
'
:
brDefaultVideo
,
'
videoTitle
'
:
brVideoTitle
};
option
[
'
definitions
'
]
=
[
'
Low Definition
'
];
option
[
'
containers
'
]
=
[
'
MP4
'
];
createMySaver
();
}
}
else
{
saver
=
{
'
warnMess
'
:
'
!videos
'
};
createMySaver
();
}
}
// =====FunnyOrDie===== //
else
if
(
page
.
url
.
indexOf
(
'
funnyordie.com/videos
'
)
!=
-
1
)
{
/* Get Video Title */
var
fodVideoTitle
=
getMyContent
(
page
.
url
,
'
meta
\\
s+property="og:title"
\\
s+content="(.*?)"
'
,
false
);
if
(
fodVideoTitle
)
{
fodVideoTitle
=
fodVideoTitle
.
replace
(
/"/g
,
'
\'
'
).
replace
(
/"/g
,
'
\'
'
).
replace
(
/"/g
,
'
\'
'
);
fodVideoTitle
=
fodVideoTitle
.
replace
(
/'/g
,
'
\'
'
).
replace
(
/'/g
,
'
\'
'
);
fodVideoTitle
=
fodVideoTitle
.
replace
(
/&/g
,
'
and
'
).
replace
(
/&/g
,
'
and
'
);
fodVideoTitle
=
fodVideoTitle
.
replace
(
/
\?
/g
,
''
).
replace
(
/
[
#:
\*]
/g
,
'
-
'
).
replace
(
/
\/
/g
,
'
-
'
);
fodVideoTitle
=
fodVideoTitle
.
replace
(
/^
\s
+|
\s
+$/
,
''
).
replace
(
/
\.
+$/g
,
''
);
}
/* Get Videos Content */
var
fodVideosContent
=
getMyContent
(
page
.
url
,
'
<video([
\\
s
\\
S]*?)video>
'
,
false
);
/* Get Videos */
if
(
fodVideosContent
)
{
var
fodVideoFormats
=
{
'
v2500.mp4
'
:
'
High Definition MP4
'
,
'
v1800.mp4
'
:
'
Standard Definition MP4
'
,
'
v600.mp4
'
:
'
Low Definition MP4
'
,
'
v600.webm
'
:
'
Low Definition WebM
'
,
'
v110.mp4
'
:
'
Very Low Definition MP4
'
};
var
fodVideoList
=
{};
var
fodVideoFound
=
false
;
var
fodVideoPath
,
fodVideoCodes
,
fodVideo
,
myVideoCode
;
fodVideoPath
=
fodVideosContent
.
match
(
/src="
(
.*
?)
v
\d
+.*
?\.
mp4"/
);
fodVideoPath
=
(
fodVideoPath
)
?
fodVideoPath
[
1
]
:
null
;
fodVideoCodes
=
fodVideosContent
.
match
(
/v
([^\/]
*
?)\/
master/
);
fodVideoCodes
=
(
fodVideoCodes
)
?
fodVideoCodes
[
1
]
:
''
;
if
(
fodVideoPath
)
{
if
(
fodVideoCodes
)
{
for
(
var
fodVideoCode
in
fodVideoFormats
)
{
if
(
fodVideoCodes
.
indexOf
(
fodVideoCode
.
replace
(
/v/
,
''
).
replace
(
/
\.
.*/
,
''
))
!=
-
1
)
{
if
(
!
fodVideoFound
)
fodVideoFound
=
true
;
fodVideo
=
fodVideoPath
+
fodVideoCode
;
myVideoCode
=
fodVideoFormats
[
fodVideoCode
];
fodVideoList
[
myVideoCode
]
=
fodVideo
;
}
}
}
else
{
for
(
var
fodVideoCode
in
fodVideoFormats
)
{
fodVideo
=
fodVideoPath
+
fodVideoCode
;
if
(
fodVideosContent
.
match
(
fodVideo
))
{
if
(
!
fodVideoFound
)
fodVideoFound
=
true
;
myVideoCode
=
fodVideoFormats
[
fodVideoCode
];
fodVideoList
[
myVideoCode
]
=
fodVideo
;
}
}
}
}
if
(
fodVideoFound
)
{
/* Create Saver */
fodDefaultVideo
=
'
Low Definition MP4
'
;
saver
=
{
'
videoList
'
:
fodVideoList
,
'
videoSave
'
:
fodDefaultVideo
,
'
videoTitle
'
:
fodVideoTitle
};
feature
[
'
container
'
]
=
false
;
option
[
'
definitions
'
]
=
[
'
High Definition
'
,
'
Standard Definition
'
,
'
Low Definition
'
,
'
Very Low Definition
'
];
option
[
'
containers
'
]
=
[
'
MP4
'
];
createMySaver
();
}
else
{
saver
=
{
'
warnMess
'
:
'
!videos
'
};
createMySaver
();
}
}
else
{
saver
=
{
'
warnMess
'
:
'
!content
'
};
createMySaver
();
}
}
// =====Veoh===== //
else
if
(
page
.
url
.
indexOf
(
'
veoh.com/watch
'
)
!=
-
1
)
{
...
...
@@ -1416,6 +1292,7 @@ function SaveTube() {
imdbVideoParse
=
imdbVideosContent
.
match
(
imdbVideoParser
);
imdbVideo
=
(
imdbVideoParse
)
?
imdbVideoParse
[
1
]
:
null
;
if
(
imdbVideo
)
{
imdbVideo
=
cleanMyContent
(
imdbVideo
,
false
);
if
(
!
imdbVideoFound
)
imdbVideoFound
=
true
;
myVideoCode
=
imdbVideoFormats
[
imdbVideoCode
];
if
(
!
imdbVideoList
[
myVideoCode
])
imdbVideoList
[
myVideoCode
]
=
imdbVideo
;
...
...
@@ -1440,6 +1317,7 @@ function SaveTube() {
imdbVideo
=
getMyContent
(
page
.
url
,
'
"videoUrl":"(.*?)"
'
,
false
);
if
(
imdbVideo
)
{
/* Create Saver */
imdbVideo
=
cleanMyContent
(
imdbVideo
,
false
);
imdbVideoList
[
imdbDefaultVideo
]
=
imdbVideo
;
var
imdbDefaultVideo
=
'
Low Definition MP4
'
;
saver
=
{
'
videoList
'
:
imdbVideoList
,
'
videoSave
'
:
imdbDefaultVideo
,
'
videoTitle
'
:
imdbVideoTitle
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment