mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
idk
This commit is contained in:
parent
2240ae7202
commit
e9110ad489
2 changed files with 33 additions and 30 deletions
50
lib/thirdparty/LBRY.class.php
vendored
50
lib/thirdparty/LBRY.class.php
vendored
|
@ -18,7 +18,6 @@ class LBRY
|
||||||
'cache' => 3600, //one hour
|
'cache' => 3600, //one hour
|
||||||
'json_response' => true
|
'json_response' => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $response['data']['lbc_usd'] ?? 0;
|
return $response['data']['lbc_usd'] ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,23 +53,17 @@ class LBRY
|
||||||
public static function connectYoutube($channel_name, $immediateSync = false)
|
public static function connectYoutube($channel_name, $immediateSync = false)
|
||||||
{
|
{
|
||||||
// Uncomment next line for production and comment other return
|
// 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 ]);
|
||||||
|
|
||||||
|
// Uncomment next line for development and comment other return (this also requires the testnet API)
|
||||||
return Curl::post(static::getApiUrl('/yt/new'), [
|
return Curl::post(static::getApiUrl('/yt/new'), [
|
||||||
'desired_lbry_channel_name' => $channel_name,
|
'desired_lbry_channel_name' => $channel_name,
|
||||||
'immediate_sync' => $immediateSync,
|
'immediate_sync' => $immediateSync,
|
||||||
|
'return_url' => 'http://localhost:8000/youtube/status/',
|
||||||
'type' => 'sync'
|
'type' => 'sync'
|
||||||
], [
|
], [
|
||||||
'json_response' => true
|
'json_response' => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 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
|
// Check the sync status
|
||||||
|
@ -86,20 +79,29 @@ class LBRY
|
||||||
|
|
||||||
public static function editYouTube($status_token, $channel_name, $email, $sync_consent)
|
public static function editYouTube($status_token, $channel_name, $email, $sync_consent)
|
||||||
{
|
{
|
||||||
if ($email == null) {
|
$postParams = array('status_token' => $status_token);
|
||||||
return Curl::post(static::getApiUrl("/yt/update"), [
|
|
||||||
'new_preferred_channel' => $channel_name,
|
if ($email) {
|
||||||
'status_token' => $status_token,
|
array_push($postParams, array('new_email' => $email));
|
||||||
'sync_consent' => $sync_consent
|
|
||||||
], ['json_response' => true]);
|
|
||||||
} else {
|
|
||||||
return Curl::post(static::getApiUrl("/yt/update"), [
|
|
||||||
'new_email' => $email,
|
|
||||||
'new_preferred_channel' => $channel_name,
|
|
||||||
'status_token' => $status_token,
|
|
||||||
'sync_consent' => $sync_consent
|
|
||||||
], ['json_response' => true]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($sync_consent) {
|
||||||
|
array_push($postParams, array('sync_consent' => $sync_consent));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ($sync_consent !== null) {
|
||||||
|
// if ($sync_consent === 0) {
|
||||||
|
// $sync_consent = null;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// array_push($postParams, ['sync_consent' => $sync_consent]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if ($new_preferred_channel) {
|
||||||
|
array_push($postParams, array('new_preferred_channel' => $channel_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Curl::post(static::getApiUrl("/yt/update"), $postParams, ['json_response' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function logWebVisitor($site, $visitorID, $IPAddress)
|
public static function logWebVisitor($site, $visitorID, $IPAddress)
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
<div class="inner-wrap inner-wrap--center-left">
|
<div class="inner-wrap inner-wrap--center-left">
|
||||||
<h1 class="weight-light">LBRY × YouTube Sync</h1>
|
<h1 class="weight-light">LBRY × YouTube Sync</h1>
|
||||||
|
<?php echo sys_get_temp_dir() ?>
|
||||||
<h2 class="weight-light">Get your YouTube videos in front of the LBRY audience</h2>
|
<h2 class="weight-light">Get your YouTube videos in front of the LBRY audience</h2>
|
||||||
<button class="button button--inverse" data-id="scroll-to-claim" type="button">Claim your channel now</button>
|
<button class="button button--inverse" data-id="scroll-to-claim" type="button">Claim your channel now</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue