-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The official instance is not operating anymore, as YouTube legal team requested me to do so #317
Comments
Could consider to some extent closing some no-key service related issues. |
We can keep no-key service related stuff as it can help rotate between regular project one and one with increase quota even if it is less useless which is maybe authorized by YouTube. Otherwise it can be helpful for people having multiple keys from different regular projects but this may not be authorized, see https://discord.com/channels/933841502155706418/933841503103627316/1231169992167526440 or even leaked ones. Initially thought about doing these modifications:diff --git a/addKey.php b/addKey.php
deleted file mode 100644
index 1bf6d46..0000000
--- a/addKey.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
- include_once 'common.php';
-
- if (isset($_GET['key'])) {
- $key = $_GET['key'];
- // Regex-based filter.
- if (isYouTubeDataAPIV3Key($key)) {
- $keysContent = file_get_contents(KEYS_FILE);
- $keys = explode("\n", $keysContent);
- // Verify that the YouTube Data API v3 key isn't already stored by the instance.
- if (!in_array($key, $keys)) {
- $httpOptions = [
- 'http' => [
- 'ignore_errors' => true,
- ]
- ];
- $content = getJSON("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=mWdFMNQBcjs&key=$key", $httpOptions, false);
- // The force secret is used to store the YouTube Data API v3 even if it's not having quota, as we assume that the trusted instance that send it to this one has checked that it has quota.
- if ($content['items'][0]['snippet']['title'] === 'A public video' || (isset($_GET['forceSecret']) && $_GET['forceSecret'] === ADD_KEY_FORCE_SECRET)) {
- file_put_contents(KEYS_FILE, ($keysContent === '' || $keysContent === false ? '' : "\n") . $key, FILE_APPEND);
- // Avoid sending another time the given key to all instances.
- if (!isset($_GET['forceSecret'])) {
- foreach (ADD_KEY_TO_INSTANCES as $addKeyToInstance) {
- getRemote($addKeyToInstance . "addKey.php?key=$key&forceSecret=" . ADD_KEY_FORCE_SECRET);
- }
- }
- echo 'YouTube Data API v3 key added.';
- } elseif ($content['error']['errors'][0]['reason'] === 'quotaExceeded') {
- // As users can set `Queries per minute` quota to 0, we avoid denial-of-service by not considering them.
- echo 'Not adding YouTube Data API v3 key having quota exceeded.';
- } else {
- // This YouTube Data API API v3 keys isn't assigned or there is another error.
- echo 'Incorrect YouTube Data API v3 key.';
- }
- } else {
- echo 'This YouTube Data API v3 key is already in the list.';
- }
- } else {
- echo "The key provided isn't a YouTube Data API v3 key.";
- }
- }
diff --git a/configuration.php b/configuration.php
index 58ae206..4d2db31 100644
--- a/configuration.php
+++ b/configuration.php
@@ -12,12 +12,4 @@
define('HTTPS_PROXY_USERNAME', '');
define('HTTPS_PROXY_PASSWORD', '');
- // No-key endpoint:
- define('KEYS_FILE', 'ytPrivate/keys.txt');
- // Both following entries can be generated with `tr -dc A-Za-z0-9 </dev/urandom | head -c 32 ; echo`.
- define('RESTRICT_USAGE_TO_KEY', '');
- // If not defined, a random value will be used to prevent denial-of-service.
- define('ADD_KEY_FORCE_SECRET', '');
- define('ADD_KEY_TO_INSTANCES', []);
-
?>
diff --git a/index.php b/index.php
index b8e4e02..591aed6 100644
--- a/index.php
+++ b/index.php
@@ -248,38 +248,6 @@
?>
-<h2>Make <?php yt(); ?> request WITHOUT ANY KEY:</h2>
-
-<p>To make <strong>ANY <?php yt(); ?> request WITHOUT ANY KEY/USING YOUR QUOTA</strong>, you can use: <?php $noKey = 'noKey'; echo url(WEBSITE_URL . "$noKey/YOUR_REQUEST"); ?></p>
-<p>For instance you can use: <?php $example = 'videos?part=snippet&id=VIDEO_ID'; echo url(WEBSITE_URL . "$noKey/$example"); ?> instead of <?php echo url("https://www.googleapis.com/youtube/v3/$example"); ?></p>
-<p>I may add in the future limitation per IP etc if the quota need to be better shared among the persons using this API.</p>
-<?php
-
- $keysCount = file_exists(KEYS_FILE) ? substr_count(file_get_contents(KEYS_FILE), "\n") + 1 : 0;
-
-?>
-<p>Currently this service is <a href='keys.php'>powered by <?php echo $keysCount; ?> keys</a>.</p>
-<script>
-
-function share() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- alert(xhttp.responseText);
- youtubeDataAPIV3KeyInput.value = '';
- }
- };
- var youtubeDataAPIV3KeyInput = document.getElementById('youtubeDataAPIV3Key');
- const key = youtubeDataAPIV3KeyInput.value;
- xhttp.open('GET', `addKey.php?key=${key}`);
- xhttp.send();
-}
-
-</script>
-
-<?php $YOUTUBE_DATA_API_V3_KEY_LENGTH = 39; ?>
-Share your YouTube Data API v3 key to power the no-key service: <input type="text" id="youtubeDataAPIV3Key" placeholder="AIzaSy..." <?php printf('minlength="%s" maxlength="%s" size="%s"', $YOUTUBE_DATA_API_V3_KEY_LENGTH, $YOUTUBE_DATA_API_V3_KEY_LENGTH, $YOUTUBE_DATA_API_V3_KEY_LENGTH) ?>><button type="button" onClick="share()">share</button>
-
<h2>Open-source:</h2>
The source code is available on GitHub: <?php echo url('https://github.com/Benjamin-Loison/YouTube-operational-API'); ?> As https://discord.com/channels/933841502155706418/933841503103627316/1294448943739961514 mentions using multiple instances. |
If everyone was fine with that removing https://yt.lemnoslife.com for just keeping the repository seems to make sense. Well curl -I https://yt.lemnoslife.com/matrix helps. I may would like to have a clever documentation generation to avoid committing with git an expanded algorithm result. Maybe GitHub page is an interesting alternative. |
Verified exhaustiveness thanks to: ```bash grep -r 'yt.lemnoslife.com' ```
Should automate Oracle account creation with Online authentication API, then automate instance creation and setting up YouTube operational API instance. IPv4=XXX.XXX.XXX.XXX
ssh ubuntu@$IPv4 sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt dist-upgrade -y
sudo apt install -y apache2 php git
sudo a2enmod rewrite headers
# Replace `AllowOverride None` with `AllowOverride All` in `<Directory /var/www/>` in `/etc/apache2/apache2.conf`.
# Is not reload, enough?
sudo service apache2 restart
sudo chown -R www-data: /var/www/
sudo apt install -y composer protobuf-compiler
sudo su -l www-data -s /bin/bash cd html/
rm index.html
git clone https://github.com/Benjamin-Loison/YouTube-operational-API .
composer require google/protobuf
protoc --php_out=proto/php/ --proto_path=proto/prototypes/ $(find proto/prototypes/ -type f) The Server Fault answer 200658 or/and https://cloud.oracle.com/networking/vcns/ocid1.vcn.oc1.eu-marseille-1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/security-lists/ocid1.securitylist.oc1.eu-marseille-1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX?region=eu-marseille-1 are necessary to make Related to Benjamin_Loison/certbot/issues/4. curl -s http://$IPv4 | grep 'This instance'
curl -s http://$IPv4/channels?handle=@MrBeast | jq .items[0].id
|
curl -s https://www.youtube.com | grep -Po 'AIzaSy[A-D][a-zA-Z0-9-_]{32}' | uniq Output:
for line in `curl -s https://www.youtube.com | grep -Po 'AIzaSy[A-D][a-zA-Z0-9-_]{32}' | uniq`
do
#echo "|$line|"
echo $line
curl "https://www.googleapis.com/youtube/v3/search?q=test&key=$line"
done Output:
|
So maybe with the right referrer DuckDuckGo and Google search node-ytpl/blob/ab62ca013de11b7a36ab159802c6fae15f00a477/test/pages/privatepage.html#L18 and similar results do not seem relevant. https://www.joesandbox.com/analysis/1351525/1/html may be interesting. |
Should consider backing up mentioned in https://discord.com/channels/933841502155706418/933841503103627316/1283796566632562760. |
Should consider potential unlimited quota, see https://discord.com/channels/933841502155706418/933841503103627316/1294441540156002315. Related to #18. |
Investigate https://www.futo.org notably https://chat.futo.org (source: https://discord.com/channels/933841502155706418/933841503103627316/1294426983962513570). |
#11#issuecomment-1325539722 specifies what account maybe to not use to act for the moment at least as a regular user. Let us delete redundant projects on my main Google account using YouTube Data API v3, as it may be against ToS and 10,000 should be enough quota for my personal usage. Related to Benjamin_Loison/youtube_push_notifications/issues/13. |
Related to Webscrap_any_website/issues/39. |
Related to Benjamin-Loison/gitea/issues/46. |
Could add an anchor to my answer email but then should maybe change the table of contents organization, hence may break previous anchors, so let us not focus on that for the moment. |
#69 may have helped reduce HTTPS requests to YouTube servers, hence their detection of our usage. |
It seems that if the former is not part of the table of contents it is because of
|
echo preg_quote("'");
|
|
<?php
title(3, 'If you don\'t have a YouTube Data API v3 developer key');
?>
<?php
title(3, 'If you already have a YouTube Data API v3 developer key');
?>
|
//$REGEX = '/^[ \t]*title\((\d), \'([^\']+)\'\);$/';
//$REGEX = '/^[ \t]*title\((\d), \'(.+)\'\);$/';
//$REGEX = '/^[ \t]*title\((\d), \'([a-zA-Z0-9\' -]+)\'\);$/';
//$REGEX = '/^[ \t]*title\((\d), \'([a-zA-Z0-9\\\' -]+)\'\);$/';
//$REGEX = '/\^\[ \\t\]\*title\\\(\(\\d\), \'\(\[a\-zA\-Z0\-9 \-\]\+\)\'\\\);\$/'; I solved the issue. |
See https://yt.lemnoslife.com.
The text was updated successfully, but these errors were encountered: