分享一些壁纸api(小鸟)

分享一些壁纸api

搜索接口

import requests

url = "https://wp.shanhutech.cn/intf/GetUpOrDownWallpaper"
querystring = {"type":"search","action":"","value":"原神","id":"2051093"}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"}
response = requests.request("POST", url, headers=headers, params=querystring)
print(response.text)

最新

import requests

url = "https://shcdn-wp.shanhutech.cn/intf/newestList"

querystring = {"pageno":"1","count":"10"}

headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"}

response = requests.request("POST", url, headers=headers, params=querystring)

print(response.text)

类别

参数说明,可以导入apipost中

[
	{
		"description": "",
		"is_checked": 1,
		"key": "pageno",
		"type": "Text",
		"not_null": 1,
		"field_type": "String",
		"value": "20"
	},
	{
		"description": "",
		"is_checked": 1,
		"key": "count",
		"type": "Text",
		"not_null": 1,
		"field_type": "String",
		"value": "20"
	},
	{
		"description": "",
		"field_type": "String",
		"is_checked": -1,
		"key": "tag",
		"value": "清纯",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "4K专区 ",
		"is_checked": -1,
		"key": "cids",
		"type": "Text",
		"not_null": 1,
		"field_type": "String",
		"value": "36"
	},
	{
		"description": "美女模特",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "6",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "爱情",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "30",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "风景",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "9",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "小清新",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "15",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "动漫",
		"field_type": "String",
		"is_checked": 1,
		"key": "cids",
		"value": "26",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "明星",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "11",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "萌宠",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "14",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "游戏",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "5",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "汽车",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "12",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "炫酷时尚",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "10",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "日历壁纸",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "29",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "影视剧照",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "7",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "节日美图",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "13",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "军事天地",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "22",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "劲爆体育",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "16",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "BABY秀",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "18",
		"not_null": 1,
		"type": "Text"
	},
	{
		"description": "文字控",
		"field_type": "String",
		"is_checked": -1,
		"key": "cids",
		"value": "35",
		"not_null": 1,
		"type": "Text"
	}
]

请求示例

import requests

url = "https://wp.shanhutech.cn/intf/GetListByCategory"

querystring = {"pageno":"20","count":"20","cids":"26"}

headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

壁纸详情

import requests

url = "https://wp.shanhutech.cn/intf/GetUpOrDownWallpaper"

querystring = {"type":"newest","action":"","value":"","id":"2062166"} # id: 壁纸id

headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

整合

上面的接口整合一下

# coding: utf-8
# 小鸟壁纸
from typing import Union

import requests
from qfluentwidgets.common.exception_handler import exceptionHandler
from common import cfg, EnumBase

XiaoNiaoBaseUrl = 'https://wp.shanhutech.cn/intf'


class MeiNv(EnumBase):
    QingChun = '清纯'
    XingGan = '性感女神'
    OuMei = '欧美女神'
    WenYi = '文艺古风'

    @staticmethod
    def type():
        return '美女模特'


class AiQing(EnumBase):
    AiQing = '爱情箴言'
    LangMan = '浪漫手绘'
    XinDong = '心动创意'
    WeiMei = '唯美温警'

    @staticmethod
    def type():
        return '爱情'


class FengJing(EnumBase):
    LanTian = '蓝天白云'
    LuoRi = '落日余晖'
    Chun = '春意盎然'
    Xia = '炎炎夏日'
    Qiu = '秋意正浓'
    Bing = '冰天雪地'
    ChengShi = '城市夜景'
    HaiYang = '海洋天堂'
    ZiRan = '自然风光'
    QiHuan = '奇幻梦境'

    @staticmethod
    def type():
        return '风景'


class XiaoQingXin(EnumBase):
    HuYan = '护眼壁纸'
    ShuHuan = '舒缓压力'
    WenXin = '温馨一刻'
    QingXin = '清新淡雅'
    JingWu = '静物写真'
    Niao = '鸟语花香'
    DongGan = '动感水果'
    JiaoYan = '娇艳欲滴'

    @staticmethod
    def type():
        return '小清新'


class DongMan(EnumBase):
    GuoMan = '国漫'
    LongZhu = '龙珠'
    HaiZei = '海贼王'
    HuoYing = '火影忍者'
    QinShi = '秦时明月'
    JuRen = '进击巨人'
    ShiShi = '食尸鬼'
    KaTong = '卡通人物'

    @staticmethod
    def type():
        return '动漫'


class MengChong(EnumBase):
    GuLingJingGuai = '古灵精怪'
    YeSheng = '野生动物'
    JiDi = '极地物种'
    Gou = '汪星人'
    Mao = '喵星人'
    MaiMeng = '卖萌图'
    Hai = '海底世界'
    Niao = '小鸟天地'

    @staticmethod
    def type():
        return '动漫'


class MingXing(EnumBase):
    XiaoZhan = '肖战'
    YangMi = '杨幂'
    YangYang = '杨洋'
    YangYin = '杨颖'
    YangZi = '杨紫'
    YangYan = '唐嫣'
    LiuShiShi = '刘诗诗'
    WangYiBo = '王一博'
    ZhaoLiYing = '赵丽颖'
    ZhangYiXing = '张艺兴'
    TFBOYS = 'TFBOYS'
    DiLiReBa = '迪丽热巴'

    @staticmethod
    def type():
        return '明星'


class YouXi(EnumBase):
    LianMeng = '英雄联盟'
    WangZhe = '王者荣耀'
    MoShou = '魔兽世界'
    ShouWang = '守望先锋'
    ZhuJi = '主机游戏'
    ShouYou = '手游世界'
    ReMen = '热门网游'
    DOTA = 'DOTA2'

    @staticmethod
    def type():
        return '游戏'


class QiChe(EnumBase):
    Bu = '布加迪'
    Lan = '兰博基尼'
    BenChi = '奔驰'
    FaLaLi = '法拉利'
    BaoMa = '宝马'
    LuHu = '路虎'
    FuTe = '福特'
    BinLi = '宾利'
    XueFuLan = '雪佛兰'
    JeiBao = '捷豹'
    HanMa = '悍马'
    JEEP = 'JEEP'
    MaShaLaDi = '玛莎拉蒂'
    AoDi = '奥迪'
    MINI = 'MINI'
    BaoShiJei = '保时捷'
    LaoSiLaiSi = '劳斯莱斯'
    KeEr = '克尔维特'

    @staticmethod
    def type():
        return '汽车'


class XiaoNiaoType(EnumBase):
    _4K = {'name': '4K专区', 'cids': 36}  # 4K专区
    MeiNv = {'name': '美女模特', 'cids': 6, 'type': MeiNv.values()}  # 美女模特
    AiQing = {'name': '爱情', 'cids': 30, 'type': AiQing.values()}  # 爱情
    Fengjing = {'name': '风景', 'cids': 9, 'type': FengJing.values()}  # 风景
    XiaoQingXin = {'name': '小清新', 'cids': 15, 'type': XiaoQingXin.values()}  # 小清新
    DongMan = {'name': '动漫', 'cids': 26, 'type': DongMan.values()}  # 动漫
    MingXing = {'name': '明星', 'cids': 11, 'type': MingXing.values()}  # 明星
    MengChong = {'name': '萌宠', 'cids': 14, 'type': MengChong.values()}  # 萌宠
    Game = {'name': '游戏', 'cids': 5, 'type': YouXi.values()}  # 游戏
    QiChe = {'name': '汽车', 'cids': 12, 'type': QiChe.values()}  # 汽车
    XuanKu = {'name': '炫酷时尚', 'cids': 10}  # 炫酷时尚
    RiLi = {'name': '日历壁纸', 'cids': 29}  # 日历壁纸
    YingShi = {'name': '影视剧照', 'cids': 7}  # 影视剧照
    JeiRi = {'name': '节日美图', 'cids': 13}  # 节日美图
    JunShi = {'name': '军事天地', 'cids': 22}  # 军事天地
    TiYu = {'name': '劲爆体育', 'cids': 16}  # 劲爆体育
    BaBy = {'name': 'BABY秀', 'cids': 18}  # BABY秀
    WenZi = {'name': '文字控', 'cids': 35}  # 文字控

    @classmethod
    def get_cids(cls, key):
        for value in cls.values():
            if value['name'] == key:
                return value['cids']


class Search:
    """
    搜索
    """
    url = XiaoNiaoBaseUrl + '/search?content={content}&pageno={page}&count={count}'
    headers = {'User-Agent': cfg.get(cfg.userAgent)}

    @classmethod
    @exceptionHandler([])
    def send(cls, content: str = '原神', page: int = 1, *, count: int = 30):
        url = cls.url.format(content=content, page=page, count=count)
        response = requests.get(url, headers=cls.headers)
        return response.json()['data']['list']


class GetListByHotTag:
    """
    按热门标签获取列表
    """
    url = XiaoNiaoBaseUrl + '/GetListByHotTag?tag={tag}&pageno={page}&count={count}'
    headers = {'User-Agent': cfg.get(cfg.userAgent)}

    @classmethod
    @exceptionHandler([])
    def send(cls, tag: Union[str, EnumBase], page: int = 1, *, count: int = 30):
        if isinstance(tag, EnumBase):
            tag = tag.value
        url = cls.url.format(tag=tag, page=page, count=count)
        response = requests.get(url, headers=cls.headers)
        return response.json()['data']['list']


class GetListByCategory:
    """
    按类别获取列表
    """
    url = XiaoNiaoBaseUrl + '/GetListByCategory?pageno={page}&count={count}&cids={cids}'
    headers = {'User-Agent': cfg.get(cfg.userAgent)}

    @classmethod
    @exceptionHandler([])
    def send(cls, page: int = 1, cids: int = 36, *, count: int = 30):
        url = cls.url.format(page=page, cids=cids, count=count)
        response = requests.get(url, headers=cls.headers)
        return response.json()['data']['list']


class NewestList:
    """
    最新的列表
    """
    url = 'https://shcdn-wp.shanhutech.cn/intf/newestList?pageno={page}&count={count}'
    headers = {'User-Agent': cfg.get(cfg.userAgent)}

    @classmethod
    @exceptionHandler([])
    def send(cls, page: int = 1, *, count: int = 30):
        url = cls.url.format(page=page, count=count)
        response = requests.get(url, headers=cls.headers)
        return response.json()

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Unity中,我们可以创建一个小鸟吃东西的简单游戏。首先,我们需要创建一个场景,在场景中放置一个小鸟模型和一些食物模型。接下来,我们需要编写一些代码来实现小鸟吃东西的功能。 首先,我们需要为小鸟添加一些基本的物理组件,例如刚体和碰撞器。这样可以让小鸟在游戏中移动和与其他物体发生碰撞。我们还需要为小鸟添加一个触发器,该触发器可以检测小鸟和食物之间的碰撞。 当小鸟与食物碰撞时,我们可以通过在小鸟的脚本中编写一些逻辑来实现吃东西的功能。首先,我们需要在小鸟的脚本中创建一个触发器事件的方法。当触发器事件被调用时,我们可以将触发事件的对象标记为被吃掉的状态,并给小鸟增加一定的分数。 除了吃东西的功能,我们还可以给小鸟添加一些特殊效果,例如吃到特殊食物后可以获得额外的能量或速度提升。 在游戏中,我们还需要添加一些障碍物,以增加游戏的难度和挑战性。当小鸟与障碍物碰撞时,可以设置游戏结束,并显示小鸟的得分。 最后,我们可以添加一些音效和动画来增加游戏的乐趣和可玩性。例如,当小鸟吃到食物时,可以播放一个吃东西的音效,当小鸟与障碍物碰撞时,可以播放一个游戏结束的音效,并添加一个爆炸的动画效果。 通过以上步骤,我们就可以在Unity中创建一个小鸟吃东西的简单游戏。这个游戏不仅可以带来娱乐,还可以提高玩家的反应能力和手眼协调能力。同时,通过添加一些额外的功能和效果,可以使游戏更加有趣和挑战。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值