Code Monkey home page Code Monkey logo

l-plugin's Introduction

l-plugin's People

Contributors

liuly0322 avatar timerainstarsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

l-plugin's Issues

使用塔罗牌报错

我这边是在群晖上使用docker搭建的云崽,然后下载了 l 插件,已经手动将所有图片下载到了对应文件夹,但依旧不能使用塔罗牌功能,日志报错是:[15:09:08.983][ERRO] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'axios' imported from /app/Yunzai-Bot/plugins/l-plugin/utils/common/download.js

完整报错如下(自下往上):

}

  code: 'ERR_MODULE_NOT_FOUND'

    at link (node:internal/modules/esm/module_job:75:36) {

    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)

    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:172:38)

    at ESMLoader.resolve (node:internal/modules/esm/loader:323:32)

    at ESMLoader.defaultResolve (node:internal/modules/esm/resolve:1058:11)

    at moduleResolve (node:internal/modules/esm/resolve:843:20)

    at packageResolve (node:internal/modules/esm/resolve:794:9)

    at new NodeError (node:internal/errors:399:5)

Did you mean to import [email protected]/node_modules/axios/index.js?

[15:09:08.983][ERRO] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'axios' imported from /app/Yunzai-Bot/plugins/l-plugin/utils/common/download.js

[15:09:08.983][ERRO] 载入插件错误:tarot

我刚刚检查了我的 download.js 文件,和库里的文件是一样的:
image

我检查了一下,我这边,roll点、吃什么、求签这几个功能可以正常使用,但包括塔罗牌在内的其他功能无法使用,请问是我哪里的配置出了问题吗?
我可以做什么,来使用 l 插件的其他功能呢?

Feature Requests: python save script & input & image output

  1. 支持input()
  2. 添加python脚本的功能
    (相当于用python写插件)
    例如:
A:#添加py脚本 aaa(注:脚本名)
B:请发送代码
A:import numpy
B:添加成功
A:#aaa
B:程序没有输出...
  1. 输出图片/GIF/视频 (?

未对 docker 限制可以使用 Python 执行恶意代码占用大量系统资源使服务器失去响应

运行环境

[root@iZhp31cfwc53651d4rso65Z ~]# lsb_release  -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.9.2009 (Core)
Release:	7.9.2009
Codename:	Core
[root@iZhp31cfwc53651d4rso65Z ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    2
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
Stepping:              7
CPU MHz:               2500.000
BogoMIPS:              5000.00
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              36608K
NUMA node0 CPU(s):     0,1
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat avx512_vnni
[root@iZhp31cfwc53651d4rso65Z ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1734         680         168           0         886         899
Swap:             0           0           0

输入

python
import os
while 1:
	os.fork() 

原理:
https://zh.wikipedia.org/zh-cn/Fork%E7%82%B8%E5%BC%B9#%E9%A2%84%E9%98%B2

问题代码

https://github.com/liuly0322/l-plugin/blob/main/apps/python.js 第40行

      let { stdout } = await execPromise(`sudo docker run -i --rm ubuntu-python-playground-img < ${fileName}`)

建议添加参数 -m 和 --cpuset 对docker限制

Miao-Yunzai使用每日一题报错

[MiaoYz][20:26:06.906][ERRO] [leetcode每日一题][dailyLeetCode]
[MiaoYz][20:26:06.907][ERRO] TypeError: puppeteer.browserInit is not a function
at default (file:///root/Miao-Yunzai/plugins/l-plugin/utils/common/screenshot.js:9:24)
at dailyLeetCode.renderQuestion (file:///root/Miao-Yunzai/plugins/l-plugin/apps/dailyLeetCode.js:92:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async dailyLeetCode (file:///root/Miao-Yunzai/plugins/l-plugin/apps/dailyLeetCode.js:114:5)
at async PluginsLoader.deal (file:///root/Miao-Yunzai/lib/plugins/loader.js:269:54)

我想提出一个建议

目前塔罗牌的图片下载链接应该是失效的。而自行下载的图片放进对应文件夹也不会被使用。
我建议将L插件进行更新,将塔罗牌的图片获取改为只有本地获取图片,同时拉取L插件或更新L插件将包含图片包[以免图片命名问题而导致失败]

leetcode 支持查询题解

记录下相关 API

获取评论

{
  "operationName": "questionSolutionArticles",
  "variables": {
    "questionSlug": "group-the-people-given-the-group-size-they-belong-to",
    "first": 10,
    "skip": 0,
    "orderBy": "DEFAULT"
  },
  "query": "query questionSolutionArticles($questionSlug: String!, $skip: Int, $first: Int, $orderBy: SolutionArticleOrderBy, $userInput: String, $tagSlugs: [String!]) {\n  questionSolutionArticles(questionSlug: $questionSlug, skip: $skip, first: $first, orderBy: $orderBy, userInput: $userInput, tagSlugs: $tagSlugs) {\n    totalNum\n    edges {\n      node {\n        ...solutionArticle\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment solutionArticle on SolutionArticleNode {\n  ipRegion\n  rewardEnabled\n  canEditReward\n  uuid\n  title\n  slug\n  sunk\n  chargeType\n  status\n  identifier\n  canEdit\n  canSee\n  reactionType\n  reactionsV2 {\n    count\n    reactionType\n    __typename\n  }\n  tags {\n    name\n    nameTranslated\n    slug\n    tagType\n    __typename\n  }\n  createdAt\n  thumbnail\n  author {\n    username\n    profile {\n      userAvatar\n      userSlug\n      realName\n      __typename\n    }\n    __typename\n  }\n  summary\n  topic {\n    id\n    commentCount\n    viewCount\n    __typename\n  }\n  byLeetcode\n  isMyFavorite\n  isMostPopular\n  isEditorsPick\n  hitCount\n  videosInfo {\n    videoId\n    coverUrl\n    duration\n    __typename\n  }\n  __typename\n}\n"
}

data.questionSolutionArticles.edges[0].node.slug 获取某篇题解的 slug(后面搜索用

edges 是一个数组

获取某篇题解

{
  "operationName": "solutionDetailArticle",
  "variables": {
    "slug": "1282-yong-hu-fen-zu-by-shenxingbang-hyj6",
    "orderBy": "DEFAULT"
  },
  "query": "query solutionDetailArticle($slug: String!, $orderBy: SolutionArticleOrderBy!) {\n  solutionArticle(slug: $slug, orderBy: $orderBy) {\n    ...solutionArticle\n    content\n    question {\n      questionTitleSlug\n      __typename\n    }\n    position\n    next {\n      slug\n      title\n      __typename\n    }\n    prev {\n      slug\n      title\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment solutionArticle on SolutionArticleNode {\n  ipRegion\n  rewardEnabled\n  canEditReward\n  uuid\n  title\n  slug\n  sunk\n  chargeType\n  status\n  identifier\n  canEdit\n  canSee\n  reactionType\n  reactionsV2 {\n    count\n    reactionType\n    __typename\n  }\n  tags {\n    name\n    nameTranslated\n    slug\n    tagType\n    __typename\n  }\n  createdAt\n  thumbnail\n  author {\n    username\n    profile {\n      userAvatar\n      userSlug\n      realName\n      __typename\n    }\n    __typename\n  }\n  summary\n  topic {\n    id\n    commentCount\n    viewCount\n    __typename\n  }\n  byLeetcode\n  isMyFavorite\n  isMostPopular\n  isEditorsPick\n  hitCount\n  videosInfo {\n    videoId\n    coverUrl\n    duration\n    __typename\n  }\n  __typename\n}\n"
}

data.solutionArticle.content 是 md 格式的文档

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.