Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Context Sensitive Group
freedombone
Commits
3bba0ea6
Commit
3bba0ea6
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Option to import videos into peertube
parent
c42ed598
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-peertube
+74
-3
74 additions, 3 deletions
src/freedombone-app-peertube
with
74 additions
and
3 deletions
src/freedombone-app-peertube
+
74
−
3
View file @
3bba0ea6
...
...
@@ -149,16 +149,86 @@ function peertube_disable_signups {
systemctl restart peertube
}
function
peertube_import_videos
{
read_config_param MY_USERNAME
read_config_param PEERTUBE_DOMAIN_NAME
read_config_param ONION_ONLY
data
=
$(
mktemp
2>/dev/null
)
dialog
--backtitle
$"Freedombone Control Panel"
\
--title
$"Import Videos"
\
--form
"Enter a channel of video URL for YouTube/Vimeo/Dailymotion"
10 75 4
\
$"Username:"
1 1
"
$MY_USERNAME
"
1 28 16 15
\
$"Password:"
2 1
""
2 28 40 10000
\
$"Video/Channel URL:"
3 1
""
3 28 40 10000
\
2>
"
$data
"
sel
=
$?
case
$sel
in
1
)
rm
-f
"
$data
"
return
;;
255
)
rm
-f
"
$data
"
return
;;
esac
peertubeuser
=
$(
sed
-n
1p <
"
$data
"
)
peertubepassword
=
$(
sed
-n
2p <
"
$data
"
)
video_url
=
$(
sed
-n
3p <
"
$data
"
)
rm
-f
"
$data
"
peertubedomain
=
"https://
$PEERTUBE_DOMAIN_NAME
"
if
[[
"
$ONION_ONLY
"
!=
'no'
]]
;
then
peertubedomain
=
"http://
$(
cat
/var/lib/tor/hidden_service_peertube/hostname
)
"
fi
if
[
${#
peertubeuser
}
-lt
3
]
;
then
dialog
--title
$"Import videos"
\
--msgbox
$"Username was not valid"
6 75
return
fi
if
[
${#
peertubepassword
}
-lt
3
]
;
then
dialog
--title
$"Import videos"
\
--msgbox
$"Password was not valid"
6 75
return
fi
if
[[
"
$video_url
"
==
*
' '
*
||
"
$video_url
"
==
*
','
*
||
"
$video_url
"
==
*
'@'
*
]]
;
then
dialog
--title
$"Import videos"
\
--msgbox
$"Video/channel URL was not valid"
6 75
return
fi
if
[
${#
video_url
}
-lt
8
]
;
then
dialog
--title
$"Import videos"
\
--msgbox
$"Video/channel URL was not valid"
6 75
return
fi
cd
$PEERTUBE_DIR
||
exit
32468356
import_script
=
$PEERTUBE_DIR
/dist/server/tools/import-videos.js
if
[
!
-f
$import_script
]
;
then
dialog
--title
$"Import videos"
\
--msgbox
$"import-videos script was not found"
6 75
return
fi
clear
node
$import_script
-u
"
$peertubedomain
"
-U
"
$peertubeuser
"
--password
"
$peertubepassword
"
-t
"
$video_url
"
dialog
--title
$"Import videos"
\
--msgbox
$"Video/s imported from
$video_url
"
6 75
}
function
configure_interactive_peertube
{
while
true
do
data
=
$(
mktemp
2>/dev/null
)
dialog
--backtitle
$"Freedombone Control Panel"
\
--title
$"PeerTube"
\
--radiolist
$"Choose an operation:"
1
0
70
4
\
--radiolist
$"Choose an operation:"
1
1
70
5
\
1
$"Set administrator email address"
off
\
2
$"Disable or enable signups"
off
\
3
$"Exit"
on 2>
"
$data
"
3
$"Import videos"
off
\
4
$"Exit"
on 2>
"
$data
"
sel
=
$?
case
$sel
in
1
)
break
;;
...
...
@@ -167,7 +237,8 @@ function configure_interactive_peertube {
case
$(
cat
"
$data
"
)
in
1
)
peertube_set_admin_email
;;
2
)
peertube_disable_signups
;;
3
)
rm
-f
"
$data
"
3
)
peertube_import_videos
;;
4
)
rm
-f
"
$data
"
break
;;
esac
rm
-f
"
$data
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment