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
Netwalk is a Python library to discover, parse, analyze and change Cisco switched networks

Netwalk is a Python library born out of a large remadiation project aimed at making network device discovery and management as fast and painless as possible.

38 Nov 07, 2022
A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

2 Jul 06, 2022
NSX-T infrastructure as code - SDDC deployment

Deploy NSX-T Infrastructure - Simple Topology by Nicolas MICHEL @vpackets / LinkedIn Introduction The purpose of this entire repository is to automate

21 Nov 28, 2022
Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.

🚀 IPpy Parallel testing of IP addresses and domains in python. Reads IP addresses and domains from a CSV file and gives two lists of accessible and i

Shivam Mathur 54 May 21, 2022
A TCP Chatroom built with python and TCP/IP sockets, consisting of a server and multiple clients which can connect with the server and chat with each other.

A TCP Chatroom built with python and TCP/IP sockets, consisting of a server and multiple clients which can connect with the server and chat with each other. It also provides an Admin role with featur

3 May 22, 2022
A Simplest TCP client and echo server

Простейшие TCP-клиент и эхо-сервер Цель работы Познакомиться с приемами работы с сетевыми сокетами в языке программирования Python. Задания для самост

Юля Нагубнева 1 Oct 25, 2021
With the use of this tool, you can change your MAC address

Akshat0404/MAC_CHANGER This tool has to be used on linux kernel. Now o

1 Jan 25, 2022
Openconnect VPN RPi Gateway

Openconnect-VPN-RPi-Gateway See the blog (Chinese) for how to build an Openconne

Zhongze Tang 2 Jan 30, 2022
Flashes keyboard leds on incoming/outgoing network packets

LED Net Capture Flashes keyboard leds on incoming/outgoing network packets Usage Requires root priviledges to run usage: ledcapture.py [-h] --keyboard

Dan Habot 56 Oct 27, 2022
A p2p chat app for zephyr

A p2p chat app for zephyr

L3gacy B3ta 4 Jun 02, 2021
RollerScanner — Fast Port Scanner Written On Python

RollerScanner RollerScanner — Fast Port Scanner Written On Python Installation You should clone this repository using: git clone https://github.com/Ma

68 Nov 09, 2022
This is a small python code that I use with my NAS server connected to Plex

Spotifarr This is a small python code that I use with my NAS server connected to Plex I didn't appreciate how Lidarr works because it downloads a full

Automator 35 Oct 04, 2022
Pritunl is a distributed enterprise vpn server built using the OpenVPN protocol.

Pritunl is a distributed enterprise vpn server built using the OpenVPN protocol.

Pritunl 3.8k Jan 03, 2023
A database-based CDN node supporting PostgreSQL and MongoDB backends.

A simple to use database-based deployable CDN node for hobbyist developers who wish to have their own CDN!

Vish M 10 Nov 19, 2022
Domain To Api [ PYTHON ]

Domain To IP Usage You Open Terminal For Run The Program python ip.py Input & Output Input Your List e.g domain.txt Output ( For Save Output File )

It's Me Jafar 0 Dec 12, 2021
DataShare - Simple library for data sharing between scripts and public functions calling

DataShare - Simple library for data sharing between scripts and public functions calling. Installation. Install code, Delete LICENSE, README, readme.t

Ivan Perzhinsky. 1 Dec 17, 2021
PcapXray - A Network Forensics Tool - To visualize a Packet Capture offline as a Network Diagram

PcapXray - A Network Forensics Tool - To visualize a Packet Capture offline as a Network Diagram including device identification, highlight important communication and file extraction

Srinivas P G 1.4k Dec 28, 2022
This tool will scans your wi-fi/wlan and show you the connected clients

This tool will scans your wi-fi/wlan and show you the connected clients

VENKAT SAI SAGAR 3 Mar 24, 2022
Jogo da forca simples com conexão entre cliente e servidor utilizando TCP.

JogoDaForcaTCP Um jogo da forca simples com conexão entre cliente e servidor utilizando o protocólo TCP. Como jogar: Habilite a porta 20000, inicie o

Kelvin Santos 1 Dec 01, 2021
A simple, 2-person chat program that runs on a single computer. No Internet, just you

localChat A simple, 2-person chat program that runs on a single computer. No Internet, just you. Simple and Local This was created with ease of use in

Owls 2 Aug 19, 2022