Add an easy example plugin
A ready .ltp that hides #fyp videos, with a short readme and the five-line source. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
20
plugins/examples/README.md
Normal file
20
plugins/examples/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Пример лёгкого плагина
|
||||
|
||||
`vasya.bez-fyp.ltp` — готовый плагин «Без fyp»: он скрывает в ленте видео с хэштегами `#fyp` и `#foryou`.
|
||||
Права ему нужны только одни: скрывать видео. В интернет он не ходит.
|
||||
|
||||
Как поставить: отправьте файл на телефон, откройте его в LihonT (Настройки мода → Плагины) и включите.
|
||||
Мод покажет, что плагин делает, прежде чем вы его включите.
|
||||
|
||||
Как сделать такой же самому: исходник лежит в `sdk/lihont-ltp/examples/01_hide_hashtag.py`, это пять строк:
|
||||
|
||||
```python
|
||||
from lihont_ltp import *
|
||||
|
||||
plugin = Plugin("Без fyp", author="Вася", description="Скрывает видео с хэштегами fyp и foryou", license="MIT")
|
||||
plugin.video(hashtag("fyp", "foryou"), hide)
|
||||
plugin.save()
|
||||
```
|
||||
|
||||
Библиотека ставится так: `pip install "git+https://git.lihont.space/lihont/LihonT.git#subdirectory=sdk/lihont-ltp"`.
|
||||
Полный разбор — в `docs/plugins-guide.md`.
|
||||
BIN
plugins/examples/vasya.bez-fyp.ltp
Normal file
BIN
plugins/examples/vasya.bez-fyp.ltp
Normal file
Binary file not shown.
@@ -1,8 +1,8 @@
|
||||
# Пример 1: скрыть видео с хэштегом #fyp (самый простой плагин).
|
||||
from lihont_ltp import *
|
||||
|
||||
plugin = Plugin("Без fyp", author="Вася", description="Скрывает видео с хэштегами fyp и foryou")
|
||||
|
||||
plugin.video(hashtag("fyp", "foryou"), hide)
|
||||
|
||||
plugin.save()
|
||||
# Пример 1: скрыть видео с хэштегом #fyp (самый простой плагин).
|
||||
from lihont_ltp import *
|
||||
|
||||
plugin = Plugin("Без fyp", author="Вася", description="Скрывает видео с хэштегами fyp и foryou", license="MIT")
|
||||
|
||||
plugin.video(hashtag("fyp", "foryou"), hide)
|
||||
|
||||
plugin.save()
|
||||
|
||||
Reference in New Issue
Block a user