import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{load as t}from"cheerio";const n=async n=>{let{language:r=``}=n.req.param(),i=Number.parseInt(n.req.query(`limit`)??`30`,10),a=`https://musify.club`,o=new URL(r,a).href,s=t(await e(o)),c=s(`div.playlist__item`).slice(0,i).toArray().map(e=>{let t=s(e),n=[t.attr(`data-artist`),t.attr(`data-name`)].filter(Boolean).join(` - `),r=t.find(`a.strong`).attr(`href`),i=t.find(`div.playlist__heading a`).toArray().map(e=>{let t=s(e);return{name:t.text(),url:t.attr(`href`)?new URL(t.attr(`href`),a).href:void 0,avatar:void 0}}),o={title:n,link:r?new URL(r,a).href:void 0,author:i},c=t.find(`div.playlist__control`).attr(`data-play-url`);return c&&(o={...o,enclosure_url:new URL(c,a).href,enclosure_type:`audio/${c.split(/\./).pop()}`,enclosure_title:n,enclosure_length:void 0,itunes_duration:void 0,itunes_item_image:void 0}),o});return{title:s(`title`).text(),description:s(`meta[property="og:description"]`).attr(`content`),link:o,item:c,allowEmpty:!0,image:s(`meta[property="og:image"]`).attr(`content`),author:s(`meta[property="og:site_name"]`).attr(`content`),id:s(`meta[property="og:url"]`).attr(`content`)}},r={path:`/:language?`,name:`Latest`,url:`musify.club`,maintainers:[`nczitzk`],handler:n,example:`/musify/en`,parameters:{category:{description:`Language, Russian by default`,options:[{label:`Russian`,value:``},{label:`English`,value:`en`}]}},description:"::: tip\nTo subscribe to [Latest](https://musify.club/en), where the source URL is `https://musify.club/en`, extract the certain parts from this URL to be used as parameters, resulting in the route as [`/musify/en`](https://rsshub.app/musify/en).\n:::",categories:[`multimedia`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`musify.club/:language`],target:`/:language`},{title:`Latest`,source:[`musify.club/en`],target:`/en`},{title:`​​Последняя`,source:[`musify.club`],target:`/`}],view:0};export{n as handler,r as route};