diff --git a/controller/Controller.class.php b/controller/Controller.class.php index 6eeba686..3918526e 100644 --- a/controller/Controller.class.php +++ b/controller/Controller.class.php @@ -111,7 +111,6 @@ class Controller $router->get(['/', 'home'], 'ContentActions::executeHome'); $router->get(['/get', 'get'], 'DownloadActions::executeGet'); - $router->get(['/getrubin', 'getrubin'], 'DownloadActions::executeGet'); foreach (array_keys(OS::getAll()) as $os) { $router->get(['/' . $os, 'get-' . $os], 'DownloadActions::executeGet'); @@ -132,20 +131,8 @@ class Controller $router->any('/dmca', 'ReportActions::executeDmca'); $router->any('/dmca/{claimid}', 'ReportActions::executeDmcaWithClaimId'); - $router->get('/escapeyoutube', 'AcquisitionActions::executeYouTube'); - $router->get('/escapeyoutubeiframe', 'AcquisitionActions::executeYouTubeIframe'); - - $router->post('/youtube/edit', 'AcquisitionActions::executeYoutubeEdit'); - $router->post('/youtube/token', 'AcquisitionActions::executeYoutubeToken'); $router->any('/youtube/status/{token}', 'AcquisitionActions::executeYoutubeStatus'); - $router->any('/youtube/status', 'AcquisitionActions::executeRedirectYoutube'); $router->any('/youtube', 'AcquisitionActions::executeYouTube'); - $router->get('/youtube/{version}', 'AcquisitionActions::executeYouTube'); - - $router->get('/verify/{token}', 'AcquisitionActions::executeVerify'); - $router->get('/verify', 'AcquisitionActions::executeAutoVerify'); - - $router->get('/follow/{claim}', 'AcquisitionActions::executeFollowCampaign'); $router->get('/i18n/get/{project}/{resource}/{language}.json', 'i18nActions::executeServeTranslationFile'); diff --git a/controller/Request.class.php b/controller/Request.class.php index 9efacd2a..3736145c 100644 --- a/controller/Request.class.php +++ b/controller/Request.class.php @@ -146,9 +146,4 @@ class Request return preg_match('/(' . join('|', $bots) . ')/i', static::getUserAgent()); } - //Method that encode html tags to special character - public static function encodeStringFromUser($string) - { - return htmlspecialchars($string, ENT_QUOTES, 'UTF-8'); - } } diff --git a/controller/Session.class.php b/controller/Session.class.php index 1fdbeb81..fda8433e 100644 --- a/controller/Session.class.php +++ b/controller/Session.class.php @@ -3,7 +3,6 @@ class Session { const KEY_LIST_SUB_ERROR = 'list_error', - KEY_YOUTUBE_SYNC_ERROR = 'youtube_sync_error', KEY_USER_CULTURE = 'user_culture'; const NAMESPACE_DEFAULT = 'default', diff --git a/controller/action/AcquisitionActions.class.php b/controller/action/AcquisitionActions.class.php index 1114a66b..d9c2ec62 100644 --- a/controller/action/AcquisitionActions.class.php +++ b/controller/action/AcquisitionActions.class.php @@ -2,130 +2,18 @@ class AcquisitionActions extends Actions { - protected static $isYouTubeDisabled = false; - - public static function isYouTubeSyncEnabled() + public static function executeYouTube() { - return !static::$isYouTubeDisabled; - } - - public static function executeFollowCampaign(string $claimName) - { - $claim = ChainQuery::findChannelClaim($claimName); - - if (!$claim || !$claim['source_url']) { - Controller::redirect('/'); - } - - $title = $claim['title'] ?: $claim['name']; - $coverUrl = $claim['source_url']; - return ['acquisition/follow_campaign', [ - 'claim' => $claim, - 'claimCount' => ChainQuery::countClaimsInChannel($claim['claim_id']), - 'title' => $title, - 'coverUrl' => $coverUrl, - ]]; - } - - public static function executeYouTubeIframe() - { - return ['acquisition/youtubeiframe', ['_no_layout' => true]]; - } - - public static function executeYouTube(string $version = '') - { - $errorMessage = Request::getParam('error_message', ''); - - if (Session::getFlash(Session::KEY_YOUTUBE_SYNC_ERROR)) { - $errorMessage = Session::getFlash(Session::KEY_YOUTUBE_SYNC_ERROR); - } - - return ['acquisition/youtube', [ - 'reward' => LBRY::youtubeReward(), - 'error_message' => $errorMessage - ]]; - } - - public static function executeVerify(string $token) - { - Response::disableHttpCache(); - return ['acquisition/verify', ['token' => $token]]; - } - - public static function executeAutoVerify() - { - Response::disableHttpCache(); - return ['acquisition/auto-verify']; - } - - public static function executeYoutubeToken() - { - Response::disableHttpCache(); - $channelName = Request::encodeStringFromUser($_POST['desired_lbry_channel_name']); - $immediateSync = (boolean)$_POST['immediate_sync']; - - if ($channelName && $channelName[0] !== "@") { - $channelName = '@' . $channelName; - } - - $token = LBRY::connectYoutube($channelName, $immediateSync); - - if ($token['success'] && $token['data']) { - Controller::redirect($token['data']); - } else { - Session::setFlash(Session::KEY_YOUTUBE_SYNC_ERROR, $token['error'] ?? "An unknown error occured."); - Controller::redirect('/youtube'); - } + return ['acquisition/youtube']; } + /* + * this is disabled, but kept around because users still access these URLs from emails + * + * it should be left as long as meaningful traffic exists to it in analytics + */ public static function executeYoutubeStatus(string $token) { - Response::disableHttpCache(); - $data = null; - - if (!static::$isYouTubeDisabled) { - $data = LBRY::statusYoutube($token); - - if (!$data['success']) { - Session::setFlash(Session::KEY_YOUTUBE_SYNC_ERROR, $data['error'] ?? "Error fetching your sync status."); - Controller::redirect('/youtube'); - } - } - - return ['acquisition/youtube_status', [ - 'token' => $token, - 'is_disabled' => static::$isYouTubeDisabled, - 'status_token' => $data, - 'error_message' => Session::getFlash(Session::KEY_YOUTUBE_SYNC_ERROR) - ]]; - } - - public static function actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent) - { - $current_value = LBRY::statusYoutube($status_token); - if ($current_value['data']['email'] == $email) { - if ($channel_name === null && $sync_consent === false) { - return Controller::redirect("/youtube/status/". $status_token); - } - $status = LBRY::editYoutube($status_token, $channel_name, null, $sync_consent); - } else { - $status = LBRY::editYoutube($status_token, $channel_name, $email, $sync_consent); - } - if ($status['success'] == false) { - Session::setFlash(Session::KEY_YOUTUBE_SYNC_ERROR, $status['error']); - Controller::redirect("/youtube/status/". $status_token); - } else { - Controller::redirect("/youtube/status/" . $status_token); - } - } - - public static function executeYoutubeEdit() - { - return ['acquisition/youtube_edit']; - } - - public static function executeRedirectYoutube() - { - return ['acquisition/youtube_status_redirect']; + return ['acquisition/youtube_status']; } } diff --git a/data/redirect/permanent.yaml b/data/redirect/permanent.yaml index 10397909..3fd43770 100644 --- a/data/redirect/permanent.yaml +++ b/data/redirect/permanent.yaml @@ -50,6 +50,7 @@ /lbry-linux-latest.deb: /get /lbry-osx-latest.dmg: /get /news/get: /get +/getrubin: /get # Mailing List /join-list: /list/subscribe @@ -141,3 +142,7 @@ /block-explorer: https://explorer.lbry.com/ /shop: https://shop.lbry.com/ +# Legacy YouTube Sync +/escapeyoutube: /youtube +/escapeyoutubeiframe: /youtube +/youtube/status: /youtube diff --git a/lib/thirdparty/ChainQuery.class.php b/lib/thirdparty/ChainQuery.class.php deleted file mode 100644 index d135dc5e..00000000 --- a/lib/thirdparty/ChainQuery.class.php +++ /dev/null @@ -1,32 +0,0 @@ -prepare("SELECT * FROM claim c WHERE c.name = ? AND c.bid_state = ?"); - $stmt->execute([$claimName, "controlling"]); - return $stmt->fetch(); - } - - public static function countClaimsInChannel($claimId) - { - $stmt = static::getInstance()->prepare("SELECT COUNT(*) FROM claim c WHERE c.publisher_id = ?"); - $stmt->execute([$claimId]); - $result = $stmt->fetch(); - return $result[0] ?? 0; - } -} diff --git a/lib/thirdparty/LBRY.class.php b/lib/thirdparty/LBRY.class.php index 0cf28ca2..b9a213fa 100644 --- a/lib/thirdparty/LBRY.class.php +++ b/lib/thirdparty/LBRY.class.php @@ -1,6 +1,5 @@ 3600, //one hour - 'json_response' => true - ]); - return $response['data']['lbc_usd'] ?? 0; - } - public static function listTags($authToken) { $response = Curl::get(static::getApiUrl('/tag/list'), ['auth_token' => $authToken], ['json_response' => true]); @@ -53,56 +43,6 @@ class LBRY return Curl::post(static::getApiUrl('/user/unsubscribe'), ['email' => $email], ['json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]); } - public static function connectYoutube($channel_name, $immediateSync = false) - { - // Uncomment next line for production and comment other return - return Curl::post(static::getApiUrl('/yt/new'), [ 'desired_lbry_channel_name' => $channel_name, 'immediate_sync' => $immediateSync, 'type' => 'sync' ], [ 'json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT ]); - - // Uncomment next line for development and comment other return (this also requires the testnet API) - // return Curl::post(static::getApiUrl('/yt/new'), [ - // 'desired_lbry_channel_name' => $channel_name, - // 'immediate_sync' => $immediateSync, - // 'return_url' => 'http://localhost:8000/youtube/status/', - // 'type' => 'sync' - // ], [ - // 'json_response' => true - // ]); - } - - // Check the sync status - public static function statusYoutube($status_token) - { - return Curl::get(static::getApiUrl('/yt/status'), ['status_token' => $status_token], ['json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]); - } - - public static function youtubeReward() - { - return CurlWithCache::post(static::getApiUrl('/yt/rewards'), [], ['cache' => 3600, 'json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]); - } - - public static function editYouTube($status_token, $channel_name, $email, $sync_consent) - { - $postParams = array('status_token' => $status_token); - - if ($email) { - $postParams['new_email'] = $email; - } - - if ($sync_consent) { - if ($sync_consent === 0) { - $sync_consent = null; - } - - $postParams['sync_consent'] = $sync_consent; - } - - if ($channel_name) { - $postParams['new_preferred_channel'] = $channel_name; - } - - return Curl::post(static::getApiUrl("/yt/update"), $postParams, ['json_response' => true, 'timeout' => static::DEFAULT_TIMEOUT]); - } - public static function logWebVisitor($site, $visitorID, $IPAddress) { if (IS_PRODUCTION) { diff --git a/view/template/acquisition/auto-verify.php b/view/template/acquisition/auto-verify.php deleted file mode 100644 index 1d4ac17b..00000000 --- a/view/template/acquisition/auto-verify.php +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Verify Your Identity - - - - - - - - - - - - -
-
-
-

Almost Done!

-
-
- -
-
-
-

Click the captcha to continue...

-
-
-
- - - - - - -
-
-
- - diff --git a/view/template/acquisition/follow_campaign.php b/view/template/acquisition/follow_campaign.php deleted file mode 100644 index 23dbdcb1..00000000 --- a/view/template/acquisition/follow_campaign.php +++ /dev/null @@ -1,84 +0,0 @@ - - -
-
-
-

Watch

-

On a platform that shares your values.

-
-
- -
-
-
- cctv camera - -

Predatory platforms like Facebook and YouTube abuse users, censor creators, enforce rules arbitrarily, and spy on everything you do.

-
-
-

LBRY is a user-controlled, open-source platform that stands for user freedom and personal choice. It has videos from .

- smile icon -
-
-
-
-
-

Step 1: Download LBRY

-

LBRY is an open-source application available on Windows, macOS, Linux, and Android, with iOS coming soon.

-
-
- 'primary'])?> - show all platforms -
-
-
-
-
-
-

Step 2: Search and Follow

-

Type in the search bar and then click Follow.

-
- How to follow <?php echo $claim['name'] ?> on LBRY -
-

If you provide your email address, you'll be notified about every new video.

-
-
-
-
-
-

Step 3 (Optional): Support

-

Use the Tip button to support and help others discover this content.

-

If you verify your account, you'll receive free credits that you can send to or other creators.

- Having trouble? Read the rewards FAQ for help. -
- How to support <?php echo $claim['name'] ?> on LBRY -
-
-
-
-
-
-

Step 4: Enjoy Peace of Mind

-

When you watch on LBRY, you're watching via a platform that is open-source, user-controlled, and censorship-resistant.

-

Unlike other platforms, it is literally impossible for LBRY to put it's thumb on the scales.

-

So what are you waiting for? Try LBRY today!

-
-
- 'primary'])?> - show all platforms -
-
-
- Not enough details for you? Read the manifesto or the docs. -
-
-
-
diff --git a/view/template/acquisition/verify.php b/view/template/acquisition/verify.php deleted file mode 100644 index 4a946658..00000000 --- a/view/template/acquisition/verify.php +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Verify Your Identity - - - - - - - - - - - - -
-
-
-

Almost Done!

-
-
- -
-
-
-

Click the captcha to continue...

-
-
-
- - -
-
-
- - diff --git a/view/template/acquisition/youtube.php b/view/template/acquisition/youtube.php index 9dd8e1d8..a2e9a28d 100644 --- a/view/template/acquisition/youtube.php +++ b/view/template/acquisition/youtube.php @@ -1,19 +1,10 @@
@@ -43,225 +34,34 @@

LBRY × YouTube Sync

-

Get your YouTube videos in front of the LBRY audience

- -
- - -
-
- " . "The following error occurred: ". $error_message . " For support please send an email to hello@lbry.com." . "

"; - endif;?> - - - -

Connect with your fans while earning rewards

- -
- - - - - - - - -
- - - - - - - -
- -
- The YouTube Program is paused for maintenance. Enter your email address and we will notify you as soon as it returns. - If you have over 10K subs on YouTube, please use this form for a manual sync request. -
- 'youtube_sync_paused', - 'submitLabel' => 'Get Started', - 'hideDisclaimer' => true, - 'largeInput' => true, - 'btnClass' => 'btn-alt btn-large', - ]) ?> - - - This will verify you are an active YouTuber. Channel names cannot be changed once chosen, please be extra careful. Additional instructions will be emailed to you after you verify your email on the next page. - Learn more - -
-
- -
-
-

Join great creators already on LBRY

-

Audiences range from 1,000+ to 10,000,000+ people. The videos below are from creators who have synced their content to LBRY.

- -
-
- - -
@3Blue1Brown
-
- -
- - -
@CasuallyExplained
-
- -
- - -
@ColinsLastStand
-
-
-
-
- -
-
-

What you earn

+

Keep your channel safe. Reach an audience of millions.


- - - - Current YouTube Subscribers - LBRY Credits/Year - USD Value 1 LBC = - - + Claim your channel now +
+
- - $rewardAmt): ?> - - - LBC - - - - - -

- Table shows yearly awards but rewards are distributed monthly. Monthly reward will be one-twelfth the above amount. These reward amounts may change at LBRY Inc.'s discretion. -

- */ ?> -

- For Views -

-

Receive up to 2 LBC () per view from verified lbry.tv accounts. This requires at least 500 subs and original content. Learn more. - These reward amounts may change at LBRY Inc.'s discretion. +

+
+

Sync Your YouTube Channel

+

+ YouTube channel sync is now a feature of odysee.com, the most popular way to access LBRY.

+

+ Just sign up at Odysee and you'll be prompted to sync your channel when you join. + It takes under a minute -- take back control and begin earning! +

+

+ Go to Odysee.com +

+ -

- For Building on LBRY -

-

You receive additional rewards for building an audience, starting with your first follower and continuing at various tiers.

-
-
- -
-
-

Getting on LBRY is easy

-

When you claim your channel your most recent 1,000 YouTube videos will be automatically copied to your LBRY channel.

- -
    -
  1. Claim your channel
  2. -
  3. Authorize your content
  4. -
  5. Users watch your content on LBRY
  6. -
- -
-
-
-
- -
-
1
-

Claim your channel

-
- -
-
2
-

Authorize your content

-
- -
-
3
-

Users watch your content on LBRY

-
-
-
-
- -
-
-

Sync & earn

-

LBRY offers a single-click sync process for existing YouTubers.

- -
- -
- -
-
-
- -
-
-

Human available

-

Questions, problems, or feedback? A real human is available.

- -
-
- Tom Zarebczan, Community Leader -
- - -

Tom Zarebczan

-

Community Leader

- tom@lbry.com -
-
+

diff --git a/view/template/acquisition/youtube_edit.php b/view/template/acquisition/youtube_edit.php deleted file mode 100644 index 0cf7e2e4..00000000 --- a/view/template/acquisition/youtube_edit.php +++ /dev/null @@ -1,18 +0,0 @@ - + +
+
+
+ + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+ +
+

LBRY × YouTube Sync

+

Get your YouTube videos in front of the LBRY audience

+ +
+
+ +
+
+ " . "The following error occurred: ". $error_message . " For support please send an email to hello@lbry.com." . "

"; + endif;?> + + + +

Connect with your fans while earning rewards

+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ The YouTube Program is paused for maintenance. Enter your email address and we will notify you as soon as it returns. + If you have over 10K subs on YouTube, please use this form for a manual sync request. +
+ 'youtube_sync_paused', + 'submitLabel' => 'Get Started', + 'hideDisclaimer' => true, + 'largeInput' => true, + 'btnClass' => 'btn-alt btn-large', + ]) ?> + + + This will verify you are an active YouTuber. Channel names cannot be changed once chosen, please be extra careful. Additional instructions will be emailed to you after you verify your email on the next page. + Learn more + +
+
+ +
+
+

Join great creators already on LBRY

+

Audiences range from 1,000+ to 10,000,000+ people. The videos below are from creators who have synced their content to LBRY.

+ +
+
+ + +
@3Blue1Brown
+
+ +
+ + +
@CasuallyExplained
+
+ +
+ + +
@ColinsLastStand
+
+
+
+
+ +
+
+

What you earn

+
+ + + + Current YouTube Subscribers + LBRY Credits/Year + USD Value 1 LBC = + + + + + $rewardAmt): ?> + + + LBC + + + + + +

+ Table shows yearly awards but rewards are distributed monthly. Monthly reward will be one-twelfth the above amount. These reward amounts may change at LBRY Inc.'s discretion. +

+ */ ?> +

+ For Views +

+

Receive up to 2 LBC () per view from verified lbry.tv accounts. This requires at least 500 subs and original content. Learn more. + These reward amounts may change at LBRY Inc.'s discretion. +

+ +

+ For Building on LBRY +

+

You receive additional rewards for building an audience, starting with your first follower and continuing at various tiers.

+
+
+ +
+
+

Getting on LBRY is easy

+

When you claim your channel your most recent 1,000 YouTube videos will be automatically copied to your LBRY channel.

+ +
    +
  1. Claim your channel
  2. +
  3. Authorize your content
  4. +
  5. Users watch your content on LBRY
  6. +
+ +
+
+
+
+ +
+
1
+

Claim your channel

+
+ +
+
2
+

Authorize your content

+
+ +
+
3
+

Users watch your content on LBRY

+
+
+
+
+ +
+
+

Sync & earn

+

LBRY offers a single-click sync process for existing YouTubers.

+ +
+ +
+ +
+
+
+ +
+
+

Human available

+

Questions, problems, or feedback? A real human is available.

+ +
+
+ Tom Zarebczan, Community Leader +
+ + +

Tom Zarebczan

+

Community Leader

+ tom@lbry.com +
+
+
+
+
diff --git a/view/template/acquisition/youtube_status.php b/view/template/acquisition/youtube_status.php index 82f72cb3..14e229cc 100644 --- a/view/template/acquisition/youtube_status.php +++ b/view/template/acquisition/youtube_status.php @@ -1,232 +1,22 @@ - - - - - - - - - - - 0 ?> - 0 ?> - - - - - if (!localStorage.getItem('status_token')) { - ga('send', 'event', 'YT Sync', '', ''); - fbq('track', 'Lead'); - - window.google_conversion_id = 980489749; - window.google_conversion_label = "B0ZpCIuLgV0QlazE0wM"; - window.google_remarketing_only = false; - window.google_conversion_format = "3"; - - var opt = new Object(); - var conv_handler = window['google_trackConversion']; - - opt.onload_callback = function() { }; - - if (typeof(conv_handler) === 'function') - conv_handler(opt); - } - - - - - - - 'error@lbry.com', - 'subscribers' => 101, - 'editable' => false, - 'status' => 'failed', - 'videos' => 1, - 'lbry_channel_name' => '@lbry', - 'expected_reward' => 1, - 'has_verified_email' => true - ] ?> - - -
-
-
- -
-

The YouTube program is down for maintenance. It will return soon.

-

Until it is back up, you cannot edit your submission. Email if you need immediate assistance.

+
+
+
+

YouTube Sync Status

- - -

- Your email address is set as .
- If this is not your email address, please change it below.
- If you have a LBRY Account, please use that email here so the accounts are merged. +

+
+
+

+ The YouTube sync program has been integrated into Odysee.

- +

+ Please sign into odysee.com using the email you joined the program with. If you accessed this page from an email, use the email address you clicked the link from. +

+

+ If you encounter any problems, please contact help@lbry.com. +

+

-

- -
- - -
-
- - - - - - - - - - - - - - - - - - - -
Your Sync StatusSubscribersVideos
- - - - - -
-
-
- -
-
-
-
- -
- - " . "The following error occurred: " . $error_message . " For support please send an email to hello@lbry.com" . "

"; endif; ?> - -
- Confirm your preferences - -

class="error-block"> - You need to provide an email -

-

class="error-block"> - You need to verify your email! Click here to resend a verification email -

- - - - - - /> - - - - - - - - - - - - - - > - - /> - - - - -
- -
-
-
- -

- - -
- Claim channel and content -

Just one step left! Take permanent ownership of your content after it's been synced to LBRY. You'll do this by claiming it on the Channels page of lbry.tv/Desktop

- -
- -

Have questions, problems, or feedback? Check out the YouTube FAQ or send us an email.

-

View Terms of Service.

diff --git a/view/template/acquisition/youtube_status_redirect.php b/view/template/acquisition/youtube_status_redirect.php deleted file mode 100644 index 544ae0df..00000000 --- a/view/template/acquisition/youtube_status_redirect.php +++ /dev/null @@ -1,9 +0,0 @@ - - if (localStorage.getItem("status_token")) { - const status_token = localStorage.getItem("status_token"); - url = "/youtube/status/" + status_token; - $(location).attr("href", url); - } else { - $(location).attr("href", "/youtube"); - } - diff --git a/view/template/acquisition/youtubeiframe.php b/view/template/acquisition/youtubeiframe.php deleted file mode 100644 index bacd235f..00000000 --- a/view/template/acquisition/youtubeiframe.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/view/template/content/roadmap.php b/view/template/content/roadmap.php index 2421f394..5f44ab30 100644 --- a/view/template/content/roadmap.php +++ b/view/template/content/roadmap.php @@ -10,7 +10,7 @@
-

Top priorities, definitions of success, status, and target completion dates for key initiatives in +

Top priorities, definitions of success, status, and target completion dates for key initiatives in