• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "youtube". Back to normal view
    1. A screenshot. Following is a user script that embeds a thumbnail into the topic header. Was supposed to be trivial, but walking around the CSRP was not that easy. Luckily, someone had written a...

      A screenshot.

      Following is a user script that embeds a thumbnail into the topic header. Was supposed to be trivial, but walking around the CSRP was not that easy. Luckily, someone had written a nice useful custom Base64 encoder, because I spent more than an hour trying to get btoa to do the thing.

      // ==UserScript==
      // @name     tildesYoutubeThumbs
      // @version  1
      // @grant    GM.xmlHttpRequest
      // @namespace   tildes.net
      // @include     https://tildes.net/~*/*
      // ==/UserScript==
      
      let youtubeIcon = document.querySelector('div.topic-icon-youtube_com')
      
      if(youtubeIcon !== null) {
        let youtubeLink = youtubeIcon.nextSibling.nextSibling.href;
        let youtubeID = new URL(youtubeLink).searchParams.get('v');
        let thumbnailUrl = "https://img.youtube.com/vi/" + youtubeID + "/0.jpg";
      
        GM.xmlHttpRequest({
          method: "GET",
          url: thumbnailUrl,
          overrideMimeType: 'text/plain; charset=x-user-defined',
          onload: function(response) {
            if(response.status === 200) {
              let thumbElement = document.createElement('img');
              let thumbParentDiv = document.createElement('div');
              let header = document.querySelector('article.topic-full > header');
              let data = "data:image/jpeg;base64," + customBase64Encode(response.responseText);
              thumbElement.src = data;
              thumbElement.style = 'width: 60%; margin: auto';
              thumbElement.id = 'gk-youtube-thumbnail';
              thumbParentDiv.style = 'width: 100%; text-align:center;';
              header.appendChild(thumbParentDiv);
              thumbParentDiv.appendChild(thumbElement);
            }
          }
        });
      }
      
      // https://stackoverflow.com/questions/8778863/downloading-an-image-using-xmlhttprequest-in-a-userscript/8781262#8781262
      function customBase64Encode (inputStr) {
          var
              bbLen               = 3,
              enCharLen           = 4,
              inpLen              = inputStr.length,
              inx                 = 0,
              jnx,
              keyStr              = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
                                  + "0123456789+/=",
              output              = "",
              paddingBytes        = 0;
          var
              bytebuffer          = new Array (bbLen),
              encodedCharIndexes  = new Array (enCharLen);
      
          while (inx < inpLen) {
              for (jnx = 0;  jnx < bbLen;  ++jnx) {
                  /*--- Throw away high-order byte, as documented at:
                    https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data
                  */
                  if (inx < inpLen)
                      bytebuffer[jnx] = inputStr.charCodeAt (inx++) & 0xff;
                  else
                      bytebuffer[jnx] = 0;
              }
      
              /*--- Get each encoded character, 6 bits at a time.
                  index 0: first  6 bits
                  index 1: second 6 bits
                              (2 least significant bits from inputStr byte 1
                               + 4 most significant bits from byte 2)
                  index 2: third  6 bits
                              (4 least significant bits from inputStr byte 2
                               + 2 most significant bits from byte 3)
                  index 3: forth  6 bits (6 least significant bits from inputStr byte 3)
              */
              encodedCharIndexes[0] = bytebuffer[0] >> 2;
              encodedCharIndexes[1] = ( (bytebuffer[0] & 0x3) << 4)   |  (bytebuffer[1] >> 4);
              encodedCharIndexes[2] = ( (bytebuffer[1] & 0x0f) << 2)  |  (bytebuffer[2] >> 6);
              encodedCharIndexes[3] = bytebuffer[2] & 0x3f;
      
              //--- Determine whether padding happened, and adjust accordingly.
              paddingBytes          = inx - (inpLen - 1);
              switch (paddingBytes) {
                  case 1:
                      // Set last character to padding char
                      encodedCharIndexes[3] = 64;
                      break;
                  case 2:
                      // Set last 2 characters to padding char
                      encodedCharIndexes[3] = 64;
                      encodedCharIndexes[2] = 64;
                      break;
                  default:
                      break; // No padding - proceed
              }
      
              /*--- Now grab each appropriate character out of our keystring,
                  based on our index array and append it to the output string.
              */
              for (jnx = 0;  jnx < enCharLen;  ++jnx)
                  output += keyStr.charAt ( encodedCharIndexes[jnx] );
          }
          return output;
      }
      
      14 votes
    2. I'm a pretty regular YouTube watcher but if I accidentally glance down at the comments section, I know my night is going to be ruined. I wondered if there is any kind of YouTube app or service...

      I'm a pretty regular YouTube watcher but if I accidentally glance down at the comments section, I know my night is going to be ruined.

      I wondered if there is any kind of YouTube app or service that lets you watch and search for videos (even access my subscribed channels) but with less of the crap, ie. the comments and related videos, which just take you down a YouTube rabbit hole that you won't get out of for hours.

      Cheers!

      19 votes
    3. In brief, I have been involved with academic Biblical scholarship for over a decade as a lay person. I was a moderator of /r/AcademicBiblical for three years. I branched off to found...

      In brief, I have been involved with academic Biblical scholarship for over a decade as a lay person. I was a moderator of /r/AcademicBiblical for three years. I branched off to found /r/AskBibleScholars over a year ago.

      After conversing with scholars and lay folk, it became apparent that the general public did not have adequate access to Biblical scholarship. So, we started a private forum at /r/CriticalBiblical in order to address this.

      One of the ways in which we have decided to remedy this inaccessibility is through a series of animated videos geared toward the uninitiated.

      Our future YouTube channel is here.

      Right now we are asking for financial support in order to produce the content for this educational endeavor. Our Patreon page is here and we would appreciate any contributions for this project. If you pledge one or two dollars per month, then it would go a long way in our collective goals. We strive to do everything that we can to keep the costs down.

      12 votes
    4. Curious how you guys feel about this as users, uploaders etc? Its an interesting question because this was generally viewed as a good move by instagram, would it be the same with Youtube. Also,...

      Curious how you guys feel about this as users, uploaders etc? Its an interesting question because this was generally viewed as a good move by instagram, would it be the same with Youtube.

      Also, from what I understand a lot of drama on Youtube has been elevated because of public seeing the subs go up/down, maybe this would change how we analyse drama. I dont say this in the sense of someone who enjoys drama, but some of these things reflect social trends/situations.

      Edit: I just want to add for clarification; Instagram is currently beta testing a feature where only you the poster can view how many likes and comments you get, the public cannot. The Youtube version would be hiding views/likes/subs from the audience, but not the content creator.

      5 votes
    5. Cooking is a hobby of mine, and as a result I really enjoy watching food related YouTube channels. Some of the ones I like are Alex French Guy Cooking - A fun channel of a creative french amateur...

      Cooking is a hobby of mine, and as a result I really enjoy watching food related YouTube channels. Some of the ones I like are

      • Alex French Guy Cooking - A fun channel of a creative french amateur cook. I like this channel because I have similar taste in food to him (check out his instant ramen series!), but his solutions to problems in the kitchen are seriously creative. To give an example, he builds a dough sheeter in his croissant series in order to get the perfect thickness of dough, and he makes a makeshift dehydrator in the ramen series. Stuff I would never do in the kitchen, but it's fun to watch.

      • Bon Appetit - I totally did not expect Bon Appetit to have such a well put together web presence (for some reason I considered them an old fashioned publication). In any case, check out the "It's Alive with Brad" series. It starts out as a series about all things related to fermentation (beer, hot sauce, kombucha, sourdough, etc), but expands a bit in scope.

      • Binging with Babish - Perhaps the most well known of recent food related YouTubers, Babish recreates meals from movies and TV. He also has a nice series on cooking tutorials. I don't watch him as much as I used to, but he's still a lot of fun.

      • Townsends - A bit different than the rest, and not exlusively food related. Townsends is a historical enthusiast focusing on the colonial era, and he has a lot of videos recreating recipes and techniques from the time period.

      EDIT:

      Forgot to include

      • Jun's Kitchen - Some seriously therapeutic cooking videos featuring sushi and cats.
      18 votes