{"id":4603,"date":"2023-01-27T01:23:00","date_gmt":"2023-01-27T07:23:00","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4603"},"modified":"2023-02-14T10:51:43","modified_gmt":"2023-02-14T16:51:43","slug":"peertube-change-video-settings-channels-from-command-line","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/peertube-change-video-settings-channels-from-command-line\/","title":{"rendered":"Peertube &#8211; Change Video Settings\/Channels from Command Line"},"content":{"rendered":"\n<p>Since Peertube uses a Postgres database, we can log in and manually do bulk changes to videos.  Things like updating a channel ID, Category, or Privacy can all be easily changed and it is easy to do bulk changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Access the Database <\/h2>\n\n\n\n<p>Login as the peertube user via ssh<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh peertube@peertube-ip<\/pre>\n\n\n\n<p>Connect to postgres<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">psql peertube_prod<\/pre>\n\n\n\n<p>View videos<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select * from video;<\/pre>\n\n\n\n<p>There is a bit much information, lets clean it up a bit<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select name,category,id,\"channelId\" from video;<\/pre>\n\n\n\n<p>View all the channels.  The id field is the channelId that is used in the above video table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select id,name from \"videoChannel\";<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Change video channel<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">update video set \"channelId\" = 100 where id = 123;<\/pre>\n\n\n\n<p>Replace 100 with the actual channelId and 123 with the id of the video.  Can use the above commands to find that info.<\/p>\n\n\n\n<p><strong>Change Privacy Settings<\/strong><\/p>\n\n\n\n<p>The privacy settings are what determine if a video is Public, Private etc.<\/p>\n\n\n\n<p>The following command can update the privacy setting for a video<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">update video set privacy = 3 where id = 101;<\/pre>\n\n\n\n<p>There are 4 privacy settings.  Change 3 to one of the following.<\/p>\n\n\n\n<p>1 = Public<br>2 = Unlisted<br>3 = Private<br>4 = Internal<\/p>\n\n\n\n<p>Change 101 to the video id you want to change.<\/p>\n\n\n\n<p>You can change the privacy settings for all videos in a channel with something like the following<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">update video set privacy = 4 where \"channelId\" = 100;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Since Peertube uses a Postgres database, we can log in and manually do bulk changes to videos. Things like updating a channel ID, Category, or Privacy can all be easily changed and it is easy to do bulk changes. Access &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/peertube-change-video-settings-channels-from-command-line\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1294,1188,1189,532],"class_list":["post-4603","post","type-post","status-publish","format-standard","hentry","category-linux","tag-peertube","tag-postgres","tag-psql","tag-video"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4603"}],"version-history":[{"count":4,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4603\/revisions"}],"predecessor-version":[{"id":4832,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4603\/revisions\/4832"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}