A library of functions that can be used to manage the download of claims from the LBRY network.

Overview

lbrytools

A library of functions that can be used to manage the download of claims from the LBRY network. It includes methods to download claims by URI (canonical url), claim ID, or from specific channels.

It also includes methods to clean up older files and free space, so the functions are suitable for use in a headless computer that will download files, and seed them to the network with little user intervention.

This libary is released as free software under the MIT license.

Motivation

The LBRY Desktop application provides basic functionality to manage downloaded claims. Real control of the system is achieved with the lbrynet headless client, also called the lbry-sdk.

This library provides convenience functions that wrap around lbrynet in order to search, download, and delete many claims easier.

This library is inspired by tuxfoo's lbry-seedit script, which provides basic functions, and a configuration file to download and seed claims. Initially tuxfoo's code was extended slightly but eventually an entire library was written from scratch to provide more functionality.

Installation

You must have the LBRY Desktop application or the lbrynet client. Get them from lbry.com/get.

You must have Python installed. Most Linux distributions come with Python ready to use; for Windows you may need to get the official package, or a full featured distribution such as Anaconda.

Copy the internal lbrytools directory, and place it inside a site-packages directory that is searched by Python. This can be in the user's home directory,

/home/user/.local/lib/python3.8/site-packages/lbrytools

or in a system-wide directory:

/usr/local/lib/python3.8/dist-packages/lbrytools
/usr/lib/python3/dist-packages/lbrytools

You can also modify the PYTHONPATH environmental variable to include the parent directory where lbrytools is located:

PYTHONPATH=/opt/git/lbrytools:$PYTHONPATH

This library was developed and tested with Python 3.8 but it may also work with earlier versions with small changes. It uses standard modules such as importlib, os, random, requests, sys, and time.

Usage

Make sure the lbrynet daemon is running either by launching the full LBRY Desktop application, or by starting the console lbrynet program.

lbrynet start

Then open a Python console, import the module, and use its methods.

import lbrytools as lbryt

lbryt.download_single(...)
lbryt.ch_download_latest(...)
lbryt.ch_download_latest_multi(...)
lbryt.redownload_latest(...)
lbryt.download_claims(...)
lbryt.print_summary()
lbryt.print_channels()
lbryt.delete_single(...)
lbryt.ch_cleanup(...)
lbryt.ch_cleanup_multi(...)
lbryt.remove_claims(...)
lbryt.measure_usage(...)
lbryt.cleanup_space(...)
lbryt.remove_media()
lbryt.count_blobs(...)
lbryt.count_blobs_all(...)
lbryt.analyze_blobs(...)
lbryt.download_missing_blobs(...)
lbryt.analyze_channel(...)
lbryt.print_channel_analysis(...)
lbryt.blobs_move(...)
lbryt.blobs_move_all(...)
lbryt.claims_bids(...)
lbryt.channel_subs(...)
lbryt.list_accounts(...)
lbryt.list_playlists(...)
lbryt.list_supports(...)
lbryt.print_blobs_ratio(...)
lbryt.create_support(...)
lbryt.abandon_support(...)
lbryt.target_support(...)

Read the lbrytools.md file for a short explanation on the most useful functions in the library.

Zeedit script

This script uses the lbrytools methods to achieve the same objective as tuxfoo's original lbry-seedit. It downloads content from various channels, and then seeds the blobs to the network. This script should be run periodically to constantly download new content, and remove the older files if they take too much space. See zeedit.py.

If lbrytools is correctly installed in the Python path, the script can be executed directly, or through the Python interpreter.

python zeedit.py [config.py]

A configuration file should be passed as the first argument.

python zeedit.py funny_config.py
python zeedit.py tech_channels_config.py
python zeedit.py cooking_conf.py

The configuration file specifies the channels to download content from, the download directory, the limit in gigabytes before cleanup of older files is started, and whether to write a summary of all downloaded claims. Modify the zeedit_config_example.py to your liking, and read the comments in it to understand what each variable does. Only the channels variable is mandatory, all others have a default value if they are missing in the configuration file.

If no argument is given, or if the provided configuration file does not exist, it will default to loading a configuration under the name zeedit_config.py; if this is not available, it will simply exit.

To keep everything contained, the lbrytools package can be placed in the same directory as zeedit.py and zeedit_config.py.

zeedit/
      zeedit.py
      zeedit_config.py
      lbrytools/
               __init___.py
               blobs.py
               ...

Development

Ideally, this collection of tools can be merged into the official LBRY sources so that everybody has access to them. Where possible, the tools should also be available from a graphical interface such as the LBRY Desktop application.

If you wish to support this work you can send a donation:

LBC: bY38MHNfE59ncq3Ch3zLW5g41ckGoHMzDq
XMR: 8565RALsab2cWsSyLg4v1dbLkd3quc7sciqFJ2mpfip6PeVyBt4ZUbZesAAVpKG1M31Qi5k9mpDSGSDpb3fK5hKYSUs8Zff
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)

gRPC - An RPC library and framework gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC

grpc 36.6k Dec 30, 2022
snappi-trex is a snappi plugin that allows executing scripts written using snappi with Cisco's TRex Traffic Generator

snappi-trex snappi-trex is a snappi plugin that allows executing scripts written using snappi with Cisco's TRex Traffic Generator Design snappi-trex c

Open Traffic Generator 14 Sep 07, 2022
A Python server and client app that tracks player session times and server status

MC Outpost A Python server and client application that tracks player session times and server status About MC Outpost provides a session graph and ser

Grant Scrits 0 Jul 23, 2021
An opensource library to use SNMP get/bulk/set/walk in Python

SNMP-UTILS An opensource library to use SNMP get/bulk/set/walk in Python Features Work with OIDS json list [Find Here](#OIDS List) GET command SET com

Alexandre Gossard 3 Aug 03, 2022
Distribute a portion of your yield to other addresses ๐Ÿ’™

YSHARE Distribute a portion of your yield to other addresses. How does it work Desposit your yToken or tokens into this contract Set the benificiaries

11 Nov 24, 2021
Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa

MAC-Converter Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa Stores the results to a file in the same dir

Stew Alexander 0 Dec 24, 2022
Securely and anonymously share files, host websites, and chat with friends using the Tor network

OnionShare OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor ne

OnionShare 5.4k Jan 01, 2023
FramIp - it a framework for work at IP and domain

FramIp FramIp - it a framework for work with IP and domain Installation (termux) $ pkg install git && pkg install python && git clone https://github.c

1 Jan 28, 2022
An advanced real time threat intelligence framework to identify threats and malicious web traffic on the basis of IP reputation and historical data.

ARTIF is a new advanced real time threat intelligence framework built that adds another abstraction layer on the top of MISP to identify threats and malicious web traffic on the basis of IP reputatio

CRED 225 Dec 31, 2022
A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT connected light.

Description A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT

Lorentz Factr 8 Dec 16, 2022
Simple DNS resolver for asyncio

Simple DNS resolver for asyncio aiodns provides a simple way for doing asynchronous DNS resolutions using pycares. Example import asyncio import aiodn

Saรบl Ibarra Corretgรฉ 471 Dec 27, 2022
Pywbem - A WBEM client and related utilities, written in pure Python.

Pywbem - A WBEM client and related utilities, written in pure Python Overview Pywbem is a WBEM client and WBEM indication listener and provides relate

PyWBEM Projects 39 Dec 22, 2022
Wifi-Jamming is a simple, yet highly effective method of causing a DoS on a wireless implemented using python pyqt5.

pyqt5-linux-wifi-jamming-tool Linux-Wifi-Jamming is a simple GUI tool, yet highly effective method of causing a DoS on a wireless implemented using py

lafesa 8 Dec 05, 2022
A gRPC-Web implementation for Python

Sonora Sonora is a Python-first implementation of gRPC-Web built on top of standard Python APIs like WSGI and ASGI for easy integration. Why? Regular

Alex Stapleton 216 Dec 30, 2022
KoreaVPN - Create a VPN App for Mac Using Automator

VPN app ๋งŒ๋“ค๊ธฐ (a.k.a. KoreaVPN) VPN์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๋“ค์–ด๊ฐ€๋Š” 10์ดˆ์˜ ์‹œ๊ฐ„์„ ์•„๋ผ๊ณ , ๊ท€์ฐฎ์Œ์„ ์ตœ์†Œํ™” ํ•˜๊ธฐ ์œ„ํ•ด ํฌ๋กค๋ง

DongHee 6 Jan 17, 2022
ip2domain - get ip to domain, Know the domian corresponding to the local network connection IP

What is Sometimes, we need to know what connections our local machine has, and what are their IP, domain name, program and parameters? get ip to domai

51pwn 4 Sep 30, 2022
Terminal based chat - networking project with sockets in python

Terminal based chat - networking project with sockets in python

2 Jan 24, 2022
This is a zeep based SOAP client wrapper for simple communication with the Bricknode SOAP API.

This is a zeep based SOAP client wrapper for simple communication with the Bricknode SOAP API.

Nord Fondkommission AB 2 Dec 15, 2021
A Network tool kit for scanning active IP addresses and open ports

Network scanner A small project that I wrote on the fly for (IT351) Computer Networks University Course to identify and label the devices in my networ

Mohamed Abdelrahman 10 Nov 07, 2022
Burp Extension that copies a request and builds a FFUF skeleton

ffuf is gaining a lot of traction within the infosec community as a fast portable web fuzzer. It has been compared and aligned (kinda) to Burp's Intruder functionality. Thus, Copy As FFUF is trying t

Desmond Miles 81 Dec 22, 2022