lbrynet.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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>lbrynet</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">lbrynet</h1>
  88. </header>
  89. <h1 id="what-is-this">What is this?</h1>
  90. <p>This is a tutorial on all things regarding lbrynet!</p>
  91. <h1 id="lbrynet-publish">lbrynet publish</h1>
  92. <p>In order to publish these are the main values you would probably want:</p>
  93. <ul>
  94. <li><code class="verbatim">bid</code> amount of LBC attached to the publication. Could be super small or large.</li>
  95. <li><code class="verbatim">name</code> part of the LBRY url e.g. <code class="verbatim">lbry://channel_name/name</code>. No special characters are allowed</li>
  96. <li><code class="verbatim">title</code> The title of the publication.</li>
  97. <li><code class="verbatim">description</code> Description, could be not added but recommended.</li>
  98. <li><code class="verbatim">thumbnail</code> A <strong>link</strong>, not <strong>file</strong> of the thumbnail. The best solution is to do a separate upload for the thumbnail get the spee.ch link of it and make that link the value. Should be automated somehow by the lbry client. Or you could not upload a thumbnail but are recommended.</li>
  99. </ul>
  100. <p>More options on <a href="https://lbry.tech/api/sdk#publish">sdk documentation</a></p>
  101. <h2 id="example-command">Example Command</h2>
  102. <div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">lbrynet</span> publish <span class="at">--name</span><span class="op">=</span>aaaaa <span class="at">--bid</span><span class="op">=</span>0.1 <span class="at">--file_path</span><span class="op">=</span><span class="st">&quot;~/aaaaa.txt&quot;</span> <span class="at">--title</span><span class="op">=</span><span class="st">&quot;aaaaa&quot;</span> <span class="at">--description</span><span class="op">=</span><span class="st">&quot;aaaaa&quot;</span> <span class="at">--channel_name</span><span class="op">=</span>@TrueAuraCoralPublishesImages</span></code></pre></div>
  103. <h1 id="projectsscripts-that-use-lbrynet">Projects/scripts that use lbrynet</h1>
  104. <ul>
  105. <li><a href="https://notabug.org/jyamihud/fastlbry-terminal">fastlbry-terminal</a> Very full featured client to the lbry network.</li>
  106. <li><a href="https://git.tristans.cloud/tristan/lyberry_qt">lyberry<sub>qt</sub></a> Very nice GUI QT client to the lbry network.
  107. <ul>
  108. <li><a href="https://codeberg.org/vertbyqb/lyberry_dmenu">lyberry dmenu</a> Using the <a href="https://git.tristans.cloud/tristan/lyberry_api">lyberry api</a> a dmenu lbry client</li>
  109. </ul></li>
  110. <li><a href="https://codeberg.org/MorsMortium/LBRY-GTK">LBRY GTK</a> GTK lbry client.</li>
  111. </ul>
  112. <h2 id="my-own-scripts">My own scripts</h2>
  113. <ul>
  114. <li><a href="https://codeberg.org/zortazert/Python-Projects/src/branch/main/lbry/yt-to-lbry.py">yt-to-lbry.py</a> sync new videos from a YouTube channel to lbry.</li>
  115. <li><a href="https://codeberg.org/zortazert/Python-Projects/src/branch/main/lbry/massupload.py">massupload.py</a> upload all files in a directory to lbry.</li>
  116. </ul>
  117. <h1 id="sign-into-lbrynet">Sign into lbrynet</h1>
  118. <p>There are two option for signing into lbrynet that I know of:</p>
  119. <ul>
  120. <li>On your system install lbry desktop and sign in there. Lbry desktop will setup the login information file for lbrynet to use.</li>
  121. <li>Try using this script. It assumes you have installed the python requests module and have lbrynet running <code class="verbatim">lbrynet start</code>. More explanations are in the file:</li>
  122. </ul>
  123. <blockquote>
  124. <p>This is a login script for the lbry SDK. Correctly using this login script will let you have complete access to the SDK's publication features. Make sure when running this script you have lbry sdk installed and running in the background of your computer. Otherwise it will not work.</p>
  125. <p>HOW? Bellow you will see a prompt asking for the Auth Token. What do you need to do:</p>
  126. <ul>
  127. <li>Go to <a href="https://odysee.com">https://odysee.com</a></li>
  128. <li>Make sure you are logged in and go to the account page.</li>
  129. <li>Right click and get into inspect element.</li>
  130. <li>In both firefox and chromium based browsers there is a network type of tab. In here you need to find auth token. Inside will be a string with the auth token.</li>
  131. <li>Do not share this to ANYONE! Copy and paste this into the Auth Token prompt.</li>
  132. </ul>
  133. <p>Next you will get basic questions asking what is your email and password to your lbry account.</p>
  134. <p>In order to check that everything worked go do this command with your sdk: (Insert test command to show things are working.</p>
  135. </blockquote>
  136. <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="im">import</span> requests</span>
  137. <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
  138. <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>auth_token <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Auth Token: &quot;</span>)</span>
  139. <span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>my_email <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Account Email: &quot;</span>)</span>
  140. <span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>my_password <span class="op">=</span> <span class="bu">input</span>(<span class="st">&quot;Account Password: &quot;</span>)</span>
  141. <span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="co">#Crete new user</span></span>
  142. <span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a>newStuff <span class="op">=</span> requests.post(<span class="st">&quot;https://api.odysee.com/user/new&quot;</span>).json()</span>
  143. <span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a>auth_token <span class="op">=</span> newStuff[<span class="st">&quot;data&quot;</span>][<span class="st">&quot;auth_token&quot;</span>]</span>
  144. <span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a></span>
  145. <span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a><span class="co">#Associate user with your account</span></span>
  146. <span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a>signInStuff <span class="op">=</span> requests.post(<span class="st">&quot;https://api.odysee.com/user/signin&quot;</span>, data<span class="op">=</span>{<span class="st">&quot;auth_token&quot;</span>:auth_token, <span class="st">&quot;email&quot;</span>:my_email, <span class="st">&quot;password&quot;</span>: my_password}).json()</span>
  147. <span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a></span>
  148. <span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a>sync_hash <span class="op">=</span> requests.post(<span class="st">&quot;http://localhost:5279/?m=sync_hash&quot;</span>, json<span class="op">=</span>{<span class="st">&quot;jsonrpc&quot;</span>:<span class="st">&quot;2.0&quot;</span>,<span class="st">&quot;method&quot;</span>:<span class="st">&quot;sync_hash&quot;</span>,<span class="st">&quot;params&quot;</span>:{}, <span class="st">&quot;id&quot;</span>: <span class="dv">1</span>}).json()[<span class="st">&quot;result&quot;</span>]</span>
  149. <span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a></span>
  150. <span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a>dontknow1 <span class="op">=</span> requests.post(<span class="st">&quot;https://api.lbry.com/sync/get&quot;</span>, data<span class="op">=</span>{<span class="st">&quot;auth_token&quot;</span>:auth_token,<span class="st">&quot;hash&quot;</span>:sync_hash}).json()</span>
  151. <span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a></span>
  152. <span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(dontknow1)</span>
  153. <span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a><span class="co"># Password probably needs to be wallet encryption password, I think default is same as Odysee password or empty</span></span>
  154. <span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a>dontknow2 <span class="op">=</span> requests.post(<span class="st">&quot;http://localhost:5279/?m=sync_apply&quot;</span>, json<span class="op">=</span>{<span class="st">&quot;jsonrpc&quot;</span>: <span class="st">&quot;2.0&quot;</span>, <span class="st">&quot;method&quot;</span>: <span class="st">&quot;sync_apply&quot;</span>, <span class="st">&quot;params&quot;</span>: {<span class="st">&quot;password&quot;</span>: <span class="st">&quot;&quot;</span>, <span class="st">&quot;blocking&quot;</span>: <span class="st">&quot;true&quot;</span>, <span class="st">&quot;data&quot;</span>: dontknow1[<span class="st">&quot;data&quot;</span>][<span class="st">&quot;data&quot;</span>]}}).json()</span>
  155. <span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a></span>
  156. <span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(dontknow2)</span></code></pre></div>
  157. <h1 id="license">License</h1>
  158. <hr>
  159. <footer>
  160. <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>
  161. 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>.
  162. </footer>
  163. </body>
  164. </html>