python-vids.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="generator" content="pandoc" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  7. <title>Vids script for Peertube, LBRY and Invidious</title>
  8. <style>
  9. code{white-space: pre-wrap;}
  10. span.smallcaps{font-variant: small-caps;}
  11. span.underline{text-decoration: underline;}
  12. div.column{display: inline-block; vertical-align: top; width: 50%;}
  13. div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
  14. ul.task-list{list-style: none;}
  15. pre > code.sourceCode { white-space: pre; position: relative; }
  16. pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
  17. pre > code.sourceCode > span:empty { height: 1.2em; }
  18. .sourceCode { overflow: visible; }
  19. code.sourceCode > span { color: inherit; text-decoration: inherit; }
  20. div.sourceCode { margin: 1em 0; }
  21. pre.sourceCode { margin: 0; }
  22. @media screen {
  23. div.sourceCode { overflow: auto; }
  24. }
  25. @media print {
  26. pre > code.sourceCode { white-space: pre-wrap; }
  27. pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
  28. }
  29. pre.numberSource code
  30. { counter-reset: source-line 0; }
  31. pre.numberSource code > span
  32. { position: relative; left: -4em; counter-increment: source-line; }
  33. pre.numberSource code > span > a:first-child::before
  34. { content: counter(source-line);
  35. position: relative; left: -1em; text-align: right; vertical-align: baseline;
  36. border: none; display: inline-block;
  37. -webkit-touch-callout: none; -webkit-user-select: none;
  38. -khtml-user-select: none; -moz-user-select: none;
  39. -ms-user-select: none; user-select: none;
  40. padding: 0 4px; width: 4em;
  41. color: #aaaaaa;
  42. }
  43. pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
  44. div.sourceCode
  45. { background-color: #f8f8f8; }
  46. @media screen {
  47. pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
  48. }
  49. code span.al { color: #ef2929; } /* Alert */
  50. code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
  51. code span.at { color: #c4a000; } /* Attribute */
  52. code span.bn { color: #0000cf; } /* BaseN */
  53. code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
  54. code span.ch { color: #4e9a06; } /* Char */
  55. code span.cn { color: #000000; } /* Constant */
  56. code span.co { color: #8f5902; font-style: italic; } /* Comment */
  57. code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
  58. code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
  59. code span.dt { color: #204a87; } /* DataType */
  60. code span.dv { color: #0000cf; } /* DecVal */
  61. code span.er { color: #a40000; font-weight: bold; } /* Error */
  62. code span.ex { } /* Extension */
  63. code span.fl { color: #0000cf; } /* Float */
  64. code span.fu { color: #000000; } /* Function */
  65. code span.im { } /* Import */
  66. code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
  67. code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
  68. code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
  69. code span.ot { color: #8f5902; } /* Other */
  70. code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
  71. code span.sc { color: #000000; } /* SpecialChar */
  72. code span.ss { color: #4e9a06; } /* SpecialString */
  73. code span.st { color: #4e9a06; } /* String */
  74. code span.va { color: #000000; } /* Variable */
  75. code span.vs { color: #4e9a06; } /* VerbatimString */
  76. code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
  77. .display.math{display: block; text-align: center; margin: 0.5rem auto;}
  78. </style>
  79. <link rel="stylesheet" href="C:\SGZ_Pro\Hobbys\Writing\Org\pages\blog\styles.css" />
  80. <!--[if lt IE 9]>
  81. <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  82. <![endif]-->
  83. <link rel='stylesheet' type='text/css' href='styles.css' />
  84. </head>
  85. <body>
  86. <header id="title-block-header">
  87. <h1 class="title">Vids script for Peertube, LBRY and Invidious</h1>
  88. </header>
  89. <h1 id="what-is-this-script">What is this script?</h1>
  90. <p>Script for searching YouTube through the invidious API, LBRY through lighthouse API and peertube through the SepiaSearch API. Played with mpv</p>
  91. <h1 id="imports">Imports</h1>
  92. <ul>
  93. <li><code class="verbatim">requests</code> for fetching data from API's</li>
  94. <li><code class="verbatim">json</code> for making json better</li>
  95. <li><code class="verbatim">os</code> for launching mpv</li>
  96. </ul>
  97. <div class="sourceCode" id="cb1"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> requests</span>
  98. <span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> json</span>
  99. <span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> os</span>
  100. <span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> sys</span></code></pre></div>
  101. <h1 id="banner">Banner</h1>
  102. <p>This is not at all necasary but I think it makes the script more fun</p>
  103. <div class="sourceCode" id="cb2"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">&#39;&#39;&#39;</span></span>
  104. <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="st">/-------------------------------</span><span class="ch">\\</span></span>
  105. <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="st">| vids |</span></span>
  106. <span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="ch">\\</span><span class="st">-------------------------------/</span></span>
  107. <span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="st">&#39;&#39;&#39;</span>)</span></code></pre></div>
  108. <h1 id="variables">Variables</h1>
  109. <ul>
  110. <li><code class="verbatim">command</code> What the video link will get launched in most likely MPV or a browser</li>
  111. </ul>
  112. <p>The colors aren't organized well there just different python color codes. All terminals are configured differently making colors show not always perfect. Better than no color I think.</p>
  113. <div class="sourceCode" id="cb3"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Use either a browser or mpv</span></span>
  114. <span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>command <span class="op">=</span> <span class="st">&quot;mpv &quot;</span></span>
  115. <span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>bold <span class="op">=</span> <span class="st">&quot;</span><span class="ch">\033</span><span class="st">[01m&quot;</span></span>
  116. <span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>norm <span class="op">=</span> <span class="st">&quot;</span><span class="ch">\033</span><span class="st">[00m&quot;</span></span>
  117. <span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>bright_cyan <span class="op">=</span> <span class="st">&quot;</span><span class="ch">\033</span><span class="st">[46m&quot;</span></span>
  118. <span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>colora <span class="op">=</span> <span class="st">&quot;</span><span class="ch">\033</span><span class="st">[45m&quot;</span></span>
  119. <span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a>colorb <span class="op">=</span> <span class="st">&quot;</span><span class="ch">\033</span><span class="st">[44m&quot;</span></span></code></pre></div>
  120. <h1 id="invidious-search">Invidious search</h1>
  121. <p>The first thing that happens is this script is put in a <code class="verbatim">try</code> function, if a argument is given to the script e.g. <code class="verbatim">-i</code> it will start doing things with it. If no, it will print out the banner.</p>
  122. <p>The if statement detects if by <code class="verbatim">sys.argv[1]</code> value if it's <code class="verbatim">-i</code>. The invidious<sub>instance</sub> is set and can be changed to a invidious instance that I like.</p>
  123. <p>The <code class="verbatim">try</code> and <code class="verbatim">except</code> statement checks to see if possibly the user did a command like:</p>
  124. <p><code class="verbatim">python vids.py -i "search query"</code></p>
  125. <p>if they didn't give that 2nd argument of the search it will just prompt them.</p>
  126. <div class="sourceCode" id="cb4"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="cf">try</span>:</span>
  127. <span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> sys.argv[<span class="dv">1</span>] <span class="op">==</span> <span class="st">&quot;-i&quot;</span>:</span>
  128. <span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> invidious_instance <span class="op">=</span> <span class="st">&quot;https://invidio.xamh.de/&quot;</span></span>
  129. <span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  130. <span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> sys.argv[<span class="dv">2</span>]</span>
  131. <span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  132. <span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Searching for: &quot;</span>)</span>
  133. <span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">str</span>(query)</span></code></pre></div>
  134. <h1 id="print-out-search-results">Print out search results</h1>
  135. <p>Using the invidious search API we fetch the search results and print them out numbered in a for loop.</p>
  136. <div class="sourceCode" id="cb5"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>size <span class="op">=</span> <span class="bu">str</span>(<span class="dv">19</span>)</span>
  137. <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>invidious_search <span class="op">=</span> invidious_instance <span class="op">+</span> <span class="st">&quot;api/v1/search?q=&quot;</span> <span class="op">+</span> query</span>
  138. <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>wol_api <span class="op">=</span> <span class="st">&quot;https://scrap.madiator.com/api/get-lbry-video?url=&quot;</span></span>
  139. <span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a></span>
  140. <span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>data <span class="op">=</span> requests.get(invidious_search)</span>
  141. <span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>json_stuff <span class="op">=</span> json.loads(data.text)</span>
  142. <span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i, vid <span class="kw">in</span> <span class="bu">enumerate</span>(json_stuff):</span>
  143. <span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, colora<span class="op">+</span>vid[<span class="st">&quot;title&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>colorb<span class="op">+</span>vid[<span class="st">&quot;author&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>bright_cyan<span class="op">+</span>vid[<span class="st">&quot;videoId&quot;</span>]<span class="op">+</span>norm)</span></code></pre></div>
  144. <h1 id="pick-a-search-result">Pick a search result</h1>
  145. <p>This while loop asks the user for a video they want to play and see the comments of. Storing the number they give in a variable so that later it can be used when parsing the json for specific stuff. The reason for a while loop with the special argument is to keep prompting the user over and over to pick the result. It has to be either greater than or equal to <strong>0</strong> or less than or equal to <strong>19</strong>.</p>
  146. <div class="sourceCode" id="cb6"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>c <span class="op">=</span> <span class="dv">100000</span></span>
  147. <span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> <span class="kw">not</span> c <span class="op">&gt;=</span> <span class="dv">0</span> <span class="kw">or</span> <span class="kw">not</span> c <span class="op">&lt;=</span> <span class="dv">19</span>:</span>
  148. <span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">input</span>(<span class="st">&#39;Number from 1-&#39;</span> <span class="op">+</span> size <span class="op">+</span> <span class="st">&quot; of the URL you want to open: &quot;</span>)</span>
  149. <span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  150. <span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">int</span>(c)</span>
  151. <span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  152. <span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="dv">100000</span></span></code></pre></div>
  153. <h1 id="comments">Comments</h1>
  154. <p>Using the invidious comment api we fetch the comments of a video with the videoId, there maybe a <strong>error</strong> in the resulting json, most likely because there are no comments. Because of this the if statement prints <code class="verbatim">could not fetch comments</code>.</p>
  155. <div class="sourceCode" id="cb7"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>comments <span class="op">=</span> invidious_instance <span class="op">+</span> <span class="st">&quot;/api/v1/comments/&quot;</span> <span class="op">+</span> json_stuff[c][<span class="st">&quot;videoId&quot;</span>]</span>
  156. <span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>data_comment <span class="op">=</span> requests.get(comments)</span>
  157. <span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>json_comment <span class="op">=</span> json.loads(data_comment.text)</span>
  158. <span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="st">&quot;error&quot;</span> <span class="kw">in</span> json_comment:</span>
  159. <span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot;could not fetch comments&quot;</span>)</span>
  160. <span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a><span class="cf">else</span>:</span>
  161. <span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> i, comment <span class="kw">in</span> <span class="bu">enumerate</span>(json_comment[<span class="st">&quot;comments&quot;</span>]):</span>
  162. <span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, colora<span class="op">+</span>comment[<span class="st">&quot;author&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>colorb<span class="op">+</span>comment[<span class="st">&quot;content&quot;</span>]<span class="op">+</span>norm)</span></code></pre></div>
  163. <h1 id="wol-api-check">WOL-api check</h1>
  164. <p>Using the WOL-API we can check if the video is available on LBRY and play with mpv from a odysee.com link over using youtube/invidious. If the lbry check gave <code class="verbatim">null</code> or what python calls it <code class="verbatim">None</code>, the link will be a youtube link, since it's what yt-dlp uses anyways. If the lbry check gave a value that's a lbry url it will play with mpv a odysee link.</p>
  165. <div class="sourceCode" id="cb8"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="co"># wol-api check</span></span>
  166. <span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>lbry_check <span class="op">=</span> requests.get(wol_api <span class="op">+</span> json_stuff[c][<span class="st">&quot;videoId&quot;</span>])</span>
  167. <span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>lbry_check <span class="op">=</span> json.loads(lbry_check.text)</span>
  168. <span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a><span class="co"># For now using odysee because yt-dlp doesn&#39;t support librarian</span></span>
  169. <span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>librarian_instance <span class="op">=</span> <span class="st">&quot;https://odysee.com/&quot;</span></span>
  170. <span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a></span>
  171. <span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> lbry_check[<span class="st">&quot;lbryurl&quot;</span>] <span class="op">==</span> <span class="va">None</span>:</span>
  172. <span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> <span class="co"># Using youtube.com since yt-dlp on any given invidious url redirects to youtube.com anyways.</span></span>
  173. <span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> selected_url <span class="op">=</span> <span class="st">&quot;https://youtube.com/watch?v=&quot;</span> <span class="op">+</span> json_stuff[c][<span class="st">&quot;videoId&quot;</span>]</span>
  174. <span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a><span class="cf">else</span>:</span>
  175. <span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot;Playing with LBRY!&quot;</span>)</span>
  176. <span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a> selected_url <span class="op">=</span> librarian_instance <span class="op">+</span> lbry_check[<span class="st">&quot;lbryurl&quot;</span>]</span>
  177. <span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> selected_url <span class="op">=</span> selected_url.replace(<span class="st">&quot;#&quot;</span>, <span class="st">&quot;:&quot;</span>)</span></code></pre></div>
  178. <h1 id="launch-in-mpv">Launch in MPV!</h1>
  179. <div class="sourceCode" id="cb9"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Do stuff with it.</span></span>
  180. <span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>os.system(command <span class="op">+</span> selected_url)</span>
  181. <span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>quit()</span></code></pre></div>
  182. <h1 id="peertube">Peertube</h1>
  183. <p>A lot of what I discussed in the invidious part of the script applies to the PeerTube part, there are just different values and API's that are worked with.</p>
  184. <div class="sourceCode" id="cb10"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="cf">elif</span> sys.argv[<span class="dv">1</span>] <span class="op">==</span> <span class="st">&quot;-p&quot;</span>:</span>
  185. <span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  186. <span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> sys.argv[<span class="dv">2</span>]</span>
  187. <span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  188. <span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Searching for: &quot;</span>)</span>
  189. <span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">str</span>(query)</span>
  190. <span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> size <span class="op">=</span> <span class="bu">str</span>(<span class="dv">19</span>)</span>
  191. <span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a> search <span class="op">=</span> <span class="st">&quot;https://sepiasearch.org/api/v1/search/videos?search=&quot;</span> <span class="op">+</span> query</span>
  192. <span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a> data <span class="op">=</span> requests.get(search)</span>
  193. <span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a> json_stuff <span class="op">=</span> json.loads(data.text)</span>
  194. <span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> i, vid <span class="kw">in</span> <span class="bu">enumerate</span>(json_stuff[<span class="st">&quot;data&quot;</span>]):</span>
  195. <span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, colora<span class="op">+</span>vid[<span class="st">&quot;name&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>colorb<span class="op">+</span>vid[<span class="st">&quot;channel&quot;</span>][<span class="st">&quot;displayName&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>bright_cyan<span class="op">+</span>vid[<span class="st">&quot;url&quot;</span>]<span class="op">+</span>norm)</span>
  196. <span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a></span>
  197. <span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a> <span class="co"># Choose a result</span></span>
  198. <span id="cb10-15"><a href="#cb10-15" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="dv">100000</span></span>
  199. <span id="cb10-16"><a href="#cb10-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">while</span> <span class="kw">not</span> c <span class="op">&gt;=</span> <span class="dv">0</span> <span class="kw">or</span> <span class="kw">not</span> c <span class="op">&lt;=</span> <span class="dv">19</span>:</span>
  200. <span id="cb10-17"><a href="#cb10-17" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">input</span>(<span class="st">&#39;Number from 1-&#39;</span> <span class="op">+</span> size <span class="op">+</span> <span class="st">&quot; of the URL you want to open: &quot;</span>)</span>
  201. <span id="cb10-18"><a href="#cb10-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  202. <span id="cb10-19"><a href="#cb10-19" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">int</span>(c)</span>
  203. <span id="cb10-20"><a href="#cb10-20" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  204. <span id="cb10-21"><a href="#cb10-21" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="dv">100000</span></span>
  205. <span id="cb10-22"><a href="#cb10-22" aria-hidden="true" tabindex="-1"></a></span>
  206. <span id="cb10-23"><a href="#cb10-23" aria-hidden="true" tabindex="-1"></a> selected_url <span class="op">=</span> json_stuff[<span class="st">&quot;data&quot;</span>][c][<span class="st">&quot;url&quot;</span>]</span></code></pre></div>
  207. <h1 id="peertube-comments">PeerTube Comments</h1>
  208. <p>This is a lot of work in progress code, it's very inefficient and only acompleshes:</p>
  209. <ul>
  210. <li>Printing out comments</li>
  211. <li>Detect if a video has replies
  212. <ul>
  213. <li>Tell how many replies</li>
  214. </ul></li>
  215. <li>Print just <strong>1</strong> of those replies</li>
  216. <li>Detect if one of the json groups is a deleted comment and if so <code class="verbatim">pass</code> and don't deal with it.</li>
  217. </ul>
  218. <div class="sourceCode" id="cb11"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>comments <span class="op">=</span> <span class="st">&quot;https://&quot;</span> <span class="op">+</span> json_stuff[<span class="st">&quot;data&quot;</span>][c][<span class="st">&quot;account&quot;</span>][<span class="st">&quot;host&quot;</span>] <span class="op">+</span> <span class="st">&quot;/api/v1/videos/&quot;</span> <span class="op">+</span> json_stuff[<span class="st">&quot;data&quot;</span>][c][<span class="st">&quot;uuid&quot;</span>] <span class="op">+</span> <span class="st">&quot;/comment-threads/&quot;</span></span>
  219. <span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>data_comment <span class="op">=</span> requests.get(comments)</span>
  220. <span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>json_comment <span class="op">=</span> json.loads(data_comment.text)</span>
  221. <span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a><span class="co"># PRINT COMMENTS!</span></span>
  222. <span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i, comment <span class="kw">in</span> <span class="bu">enumerate</span>(json_comment[<span class="st">&quot;data&quot;</span>]):</span>
  223. <span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="co"># Sometimes peertube likes to give nonsese json</span></span>
  224. <span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> comment[<span class="st">&quot;account&quot;</span>] <span class="op">==</span> <span class="va">None</span>:</span>
  225. <span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">pass</span></span>
  226. <span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a></span>
  227. <span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a> <span class="co"># This detects if a comment has replies.</span></span>
  228. <span id="cb11-11"><a href="#cb11-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">elif</span> comment[<span class="st">&quot;totalReplies&quot;</span>] <span class="op">&gt;</span> <span class="dv">0</span>:</span>
  229. <span id="cb11-12"><a href="#cb11-12" aria-hidden="true" tabindex="-1"></a> replies <span class="op">=</span> comments <span class="op">+</span> <span class="bu">str</span>(comment[<span class="st">&quot;id&quot;</span>])</span>
  230. <span id="cb11-13"><a href="#cb11-13" aria-hidden="true" tabindex="-1"></a> data_replies <span class="op">=</span> requests.get(replies)</span>
  231. <span id="cb11-14"><a href="#cb11-14" aria-hidden="true" tabindex="-1"></a> json_replies <span class="op">=</span> json.loads(data_replies.text)</span>
  232. <span id="cb11-15"><a href="#cb11-15" aria-hidden="true" tabindex="-1"></a> total_replies <span class="op">=</span> <span class="bu">str</span>(json_replies[<span class="st">&quot;comment&quot;</span>][<span class="st">&quot;totalReplies&quot;</span>])</span>
  233. <span id="cb11-16"><a href="#cb11-16" aria-hidden="true" tabindex="-1"></a> <span class="co"># Print out that this comment has replies and also say how many</span></span>
  234. <span id="cb11-17"><a href="#cb11-17" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, colora<span class="op">+</span>comment[<span class="st">&quot;account&quot;</span>][<span class="st">&quot;displayName&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>colorb<span class="op">+</span>comment[<span class="st">&quot;text&quot;</span>]<span class="op">+</span>norm<span class="op">+</span>bright_cyan<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">REPLIES: &quot;</span><span class="op">+</span>total_replies<span class="op">+</span>norm)</span>
  235. <span id="cb11-18"><a href="#cb11-18" aria-hidden="true" tabindex="-1"></a> <span class="co"># Here in this for loop inside of a for loop for replys</span></span>
  236. <span id="cb11-19"><a href="#cb11-19" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> i, reply <span class="kw">in</span> <span class="bu">enumerate</span>(json_replies[<span class="st">&quot;children&quot;</span>]):</span>
  237. <span id="cb11-20"><a href="#cb11-20" aria-hidden="true" tabindex="-1"></a> <span class="co"># Same thing can happen where it gives nonsense json.</span></span>
  238. <span id="cb11-21"><a href="#cb11-21" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> reply[<span class="st">&quot;comment&quot;</span>][<span class="st">&quot;account&quot;</span>] <span class="op">==</span> <span class="va">None</span>:</span>
  239. <span id="cb11-22"><a href="#cb11-22" aria-hidden="true" tabindex="-1"></a> <span class="cf">pass</span></span>
  240. <span id="cb11-23"><a href="#cb11-23" aria-hidden="true" tabindex="-1"></a> <span class="co"># This prints out the first reply.</span></span>
  241. <span id="cb11-24"><a href="#cb11-24" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span>:</span>
  242. <span id="cb11-25"><a href="#cb11-25" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&quot; &quot;</span> <span class="op">+</span> <span class="bu">str</span>(i) <span class="op">+</span> <span class="st">&quot; &quot;</span> <span class="op">+</span> colora<span class="op">+</span>reply[<span class="st">&quot;comment&quot;</span>][<span class="st">&quot;account&quot;</span>][<span class="st">&quot;displayName&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st"> &quot;</span><span class="op">+</span>colorb<span class="op">+</span>reply[<span class="st">&quot;comment&quot;</span>][<span class="st">&quot;text&quot;</span>]<span class="op">+</span>norm)</span>
  243. <span id="cb11-26"><a href="#cb11-26" aria-hidden="true" tabindex="-1"></a></span>
  244. <span id="cb11-27"><a href="#cb11-27" aria-hidden="true" tabindex="-1"></a> <span class="co"># This is the final thing, the comment has no replys so it just</span></span>
  245. <span id="cb11-28"><a href="#cb11-28" aria-hidden="true" tabindex="-1"></a> <span class="co"># prints it as a comment.</span></span>
  246. <span id="cb11-29"><a href="#cb11-29" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span>:</span>
  247. <span id="cb11-30"><a href="#cb11-30" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, colora<span class="op">+</span>comment[<span class="st">&quot;account&quot;</span>][<span class="st">&quot;displayName&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>colorb<span class="op">+</span>comment[<span class="st">&quot;text&quot;</span>]<span class="op">+</span>norm)</span>
  248. <span id="cb11-31"><a href="#cb11-31" aria-hidden="true" tabindex="-1"></a></span>
  249. <span id="cb11-32"><a href="#cb11-32" aria-hidden="true" tabindex="-1"></a>os.system(command <span class="op">+</span> selected_url)</span></code></pre></div>
  250. <h1 id="lbry">LBRY</h1>
  251. <p>This section is for LBRY, and printing out the search results of the search.</p>
  252. <div class="sourceCode" id="cb12"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="cf">elif</span> sys.argv[<span class="dv">1</span>] <span class="op">==</span> <span class="st">&quot;-l&quot;</span>:</span>
  253. <span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  254. <span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> sys.argv[<span class="dv">2</span>]</span>
  255. <span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  256. <span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Searching for: &quot;</span>)</span>
  257. <span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a> query <span class="op">=</span> <span class="bu">str</span>(query)</span>
  258. <span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a> size <span class="op">=</span> <span class="bu">str</span>(<span class="dv">30</span>)</span>
  259. <span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a> search <span class="op">=</span> <span class="st">&#39;https://lighthouse.lbry.com/search?s=&#39;</span> <span class="op">+</span> query <span class="op">+</span> <span class="st">&#39;&amp;include=channel,channel_claim_id,title&amp;size=&#39;</span> <span class="op">+</span> size</span>
  260. <span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a> lbry <span class="op">=</span> <span class="st">&quot;https://lbry.ix.tc/&quot;</span></span>
  261. <span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a></span>
  262. <span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a> data <span class="op">=</span> requests.get(search)</span>
  263. <span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a> json_stuff <span class="op">=</span> json.loads(data.text)</span>
  264. <span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a></span>
  265. <span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a> <span class="co"># Results</span></span>
  266. <span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> i, x <span class="kw">in</span> <span class="bu">enumerate</span>(json_stuff):</span>
  267. <span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a> pre <span class="op">=</span> <span class="st">&quot;lbry://&quot;</span></span>
  268. <span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> x[<span class="st">&quot;channel&quot;</span>]:</span>
  269. <span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a> pre <span class="op">+=</span> x[<span class="st">&quot;channel&quot;</span>] <span class="op">+</span> <span class="st">&quot;/&quot;</span></span>
  270. <span id="cb12-19"><a href="#cb12-19" aria-hidden="true" tabindex="-1"></a> url <span class="op">=</span> pre <span class="op">+</span> x[<span class="st">&quot;name&quot;</span>]</span>
  271. <span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, bright_cyan<span class="op">+</span>x[<span class="st">&quot;title&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>url)</span></code></pre></div>
  272. <h1 id="lbry-comments">LBRY comments</h1>
  273. <p>Using the librarian comment api after gathering a lot of information about the publication it is possible to get the comments.</p>
  274. <div class="sourceCode" id="cb13"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Choose a result</span></span>
  275. <span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a>c <span class="op">=</span> <span class="dv">100000</span></span>
  276. <span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> <span class="kw">not</span> c <span class="op">&gt;=</span> <span class="dv">0</span> <span class="kw">or</span> <span class="kw">not</span> c <span class="op">&lt;=</span> <span class="dv">29</span>:</span>
  277. <span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">input</span>(<span class="st">&#39;Number from 1-&#39;</span> <span class="op">+</span> size <span class="op">+</span> <span class="st">&quot; of the URL you want to open: &quot;</span>)</span>
  278. <span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">try</span>:</span>
  279. <span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="bu">int</span>(c)</span>
  280. <span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">except</span>:</span>
  281. <span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a> c <span class="op">=</span> <span class="dv">100000</span></span>
  282. <span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a>selected_url <span class="op">=</span> json_stuff[c]</span>
  283. <span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a><span class="co"># Do stuff with it.</span></span>
  284. <span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a>channel_name <span class="op">=</span> selected_url[<span class="st">&quot;channel&quot;</span>]</span>
  285. <span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a>channel_ID <span class="op">=</span> selected_url[<span class="st">&quot;channel_claim_id&quot;</span>]</span>
  286. <span id="cb13-13"><a href="#cb13-13" aria-hidden="true" tabindex="-1"></a></span>
  287. <span id="cb13-14"><a href="#cb13-14" aria-hidden="true" tabindex="-1"></a>claim_ID <span class="op">=</span> selected_url[<span class="st">&quot;claimId&quot;</span>]</span>
  288. <span id="cb13-15"><a href="#cb13-15" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="bu">str</span>(lbry <span class="op">+</span> <span class="st">&quot;api/comments?claim_id=&quot;</span> <span class="op">+</span> claim_ID <span class="op">+</span> <span class="st">&quot;&amp;channel_id=&quot;</span> <span class="op">+</span> channel_ID <span class="op">+</span> <span class="st">&quot;&amp;channel_name=&quot;</span> <span class="op">+</span> channel_name <span class="op">+</span> <span class="st">&quot;&amp;page=1&amp;page_size=15&quot;</span>)</span>
  289. <span id="cb13-16"><a href="#cb13-16" aria-hidden="true" tabindex="-1"></a></span>
  290. <span id="cb13-17"><a href="#cb13-17" aria-hidden="true" tabindex="-1"></a>comments <span class="op">=</span> requests.get(url)</span>
  291. <span id="cb13-18"><a href="#cb13-18" aria-hidden="true" tabindex="-1"></a>json_comments <span class="op">=</span> json.loads(comments.text)</span>
  292. <span id="cb13-19"><a href="#cb13-19" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i, x <span class="kw">in</span> <span class="bu">enumerate</span>(json_comments[<span class="st">&quot;comments&quot;</span>]):</span>
  293. <span id="cb13-20"><a href="#cb13-20" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(i, bright_cyan<span class="op">+</span>x[<span class="st">&quot;Channel&quot;</span>][<span class="st">&quot;Name&quot;</span>]<span class="op">+</span>norm<span class="op">+</span><span class="st">&quot;</span><span class="ch">\n</span><span class="st">&quot;</span><span class="op">+</span>x[<span class="st">&quot;Comment&quot;</span>])</span>
  294. <span id="cb13-21"><a href="#cb13-21" aria-hidden="true" tabindex="-1"></a></span>
  295. <span id="cb13-22"><a href="#cb13-22" aria-hidden="true" tabindex="-1"></a>url <span class="op">=</span> <span class="st">&quot;https://odysee.com/&quot;</span> <span class="op">+</span> selected_url[<span class="st">&quot;channel&quot;</span>] <span class="op">+</span> <span class="st">&quot;/&quot;</span> <span class="op">+</span> selected_url[<span class="st">&quot;name&quot;</span>]</span>
  296. <span id="cb13-23"><a href="#cb13-23" aria-hidden="true" tabindex="-1"></a>os.system(command <span class="op">+</span> url)</span>
  297. <span id="cb13-24"><a href="#cb13-24" aria-hidden="true" tabindex="-1"></a>quit()</span></code></pre></div>
  298. <h1 id="help">HELP</h1>
  299. <p>Using the -h argument the user can get some help aobut how to use the program.</p>
  300. <div class="sourceCode" id="cb14"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">elif</span> sys.argv[<span class="dv">1</span>] <span class="op">==</span> <span class="st">&quot;-h&quot;</span>:</span>
  301. <span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&#39;&#39;&#39;</span></span>
  302. <span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a><span class="st">Command:</span></span>
  303. <span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a><span class="st">python vids.py &lt;arg&gt;</span></span>
  304. <span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a><span class="st">After doing this you will be prompted to make a search</span></span>
  305. <span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a><span class="st">If you want you can make the search in the command by doing</span></span>
  306. <span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a><span class="st">python vids.py &lt;arg&gt; &quot;search&quot;</span></span>
  307. <span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a><span class="st">-l for lighthouse (LBRY network)</span></span>
  308. <span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a><span class="st">-p for sepia (Peertube)</span></span>
  309. <span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a><span class="st">-i for invidious) (YouTube) </span></span>
  310. <span id="cb14-11"><a href="#cb14-11" aria-hidden="true" tabindex="-1"></a><span class="st">NOTE: All youtube links will be checked with the Watch on LBRY API. If</span></span>
  311. <span id="cb14-12"><a href="#cb14-12" aria-hidden="true" tabindex="-1"></a><span class="st">the video is available on the lbry network, the youtube search result</span></span>
  312. <span id="cb14-13"><a href="#cb14-13" aria-hidden="true" tabindex="-1"></a><span class="st">will be opened in a odysee.com link.</span></span>
  313. <span id="cb14-14"><a href="#cb14-14" aria-hidden="true" tabindex="-1"></a><span class="st">&#39;&#39;&#39;</span>)</span>
  314. <span id="cb14-15"><a href="#cb14-15" aria-hidden="true" tabindex="-1"></a><span class="cf">except</span>:</span>
  315. <span id="cb14-16"><a href="#cb14-16" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">&#39;&#39;</span>)</span></code></pre></div>
  316. <hr>
  317. <footer>
  318. <a rel='license' href='http://creativecommons.org/licenses/by-sa/4.0/'><img alt='Creative Commons License' style='border-width:0' width='88' height='31' src='../images/cc-by-sa.png' /></a><br>
  319. Unless otherwise noted, all content on this website is Copyright Zortazert 2021-2022 and is licensed under <a rel='license' href='http://creativecommons.org/licenses/by-sa/4.0/'>CC BY-SA 4.0</a>.
  320. </footer>
  321. </body>
  322. </html>