import{t as e}from"./config-BYRrjYC5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./got-BBDj7u1e.mjs";import{t as i}from"./config-not-found-B9AOp828.mjs";import{n as a}from"./util-CurzPo-N.mjs";const o={path:`/now/:location`,categories:[`forecast`],example:`/qweather/now/广州`,parameters:{location:`N`},features:{requireConfig:[{name:`HEFENG_KEY`,description:"访问 `https://www.qweather.com/` 注册开发 API Key。"},{name:`HEFENG_API_HOST`,description:`This is required after 2026/01/01: https://blog.qweather.com/announce/public-api-domain-change-to-api-host/`}],requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`实时天气`,maintainers:[`Rein-Ou`],handler:s};async function s(o){if(!e.hefeng.key||!e.hefeng.apiHost)throw new i(`QWeather RSS is disabled due to the lack of <a href="https://docs.rsshub.app/zh/install/config#%E5%92%8C%E9%A3%8E%E5%A4%A9%E6%B0%94">relevant config</a>`);let s=`https://${e.hefeng.apiHost}/v7/weather/now`,c=`https://${e.hefeng.apiHost}/geo/v2/city/lookup`,l=await t.tryGet(`qweather:`+o.req.param(`location`)+`:id`,async()=>(await r(`${c}?location=${o.req.param(`location`)}&key=${e.hefeng.key}`)).data.location.map(e=>e)[0].id),u=`${s}?key=${e.hefeng.key}&location=${l}`,d=await t.tryGet(`qweather:`+o.req.param(`location`)+`:now`,async()=>(await r(u)).data,3600,!1),f=[d.now],p=n(d.updateTime),m=p.toLocaleString();return{title:o.req.param(`location`)+`实时天气`,description:o.req.param(`location`)+`实时天气状况`,item:f.map(e=>({title:`观测时间：`+m,description:a(e),pubDate:p,guid:`位置:`+o.req.param(`location`)+`--时间：`+m,link:d.fxLink})),link:d.fxLink}}export{o as route};