예제 #1
0
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>{$title}</title>
        <link>https://kotomi-rss.moe/</link>
        <description>KOTOMI RSS 资源页</description>
        <language>zh-cn</language>
        <copyright>版权属于原作者所有,本站仅作索引。</copyright>
        <pubDate>{$date}</pubDate>

EOF;
foreach ($result as $res) {
    /// 对于漫游,使用 guid 作为资源链接,对于花园,使用 magnet 作为资源链接
    $link = $res['guid'];
    $btih = $res['btih'];
    if ($USE_LOCAL_SEED == TRUE && $btih != '') {
        $link = '/' . btih_seed_url($btih);
        $link = mkurl($link);
    }
    /**
     * 为向后兼容,对 guid 的特殊处理
     * 在 popgo-gone 版本之前,当 $USE_LOCAL_SEED == TRUE 时,对于漫游资源,我们会输出本地种子地址作为 guid
     * 而现在,我们会直接使用原始源的 RSS guid 作为 guid,也就是说,如果 USE_LOCAL_SEED == TRUE 时,如果我们不做处理,
     * 那么输出的 RSS 中的漫游资源的 guid 会改变,这会导致重复下载。
     * 为了解决此问题,在此对 guid 做特殊处理:
     * 1. 如果资源是漫游的,则按照旧方法对 guid 进行处理
     * 2. 如果资源不是漫游的,则直接输出原始 RSS 中的 guid
     */
    $guid = $res['guid'];
    if ($res['src'] == 'popgo') {
        $guid = $link;
    }
예제 #2
0
      <div class="container-fluid desc">
        <div class="row">
          
          <div class="col-sm-12">
            <div class="alert content">
              <?php 
echo $res['description'];
?>
            </div>
          </div>
          
          
          <div class="col-sm-12">
            <div class="alert content">
              <?php 
$seed_url = btih_seed_url($res['btih']);
$seed_url = htmlspecialchars($seed_url);
$magnet = htmlspecialchars($res['magnet']);
$popularity = '未知';
if ($res['popularity'] >= 0) {
    $decays = (time() - $res['pmtime']) / 86400 / $POPULARITY_HALFLIFE_DAYS;
    $popularity = round($res['popularity'] * pow(2, -1 * $decays));
}
?>
              <p>资源来源: <a href="<?php 
echo htmlspecialchars($res['link']);
?>
"><?php 
echo htmlspecialchars($res['src']);
?>
</p></a>
예제 #3
0
foreach ($result as $res) {
    $btih = $res['btih'];
    $link = $res['magnet'];
    if ($link == '') {
        $match;
        $hash = preg_match('([0-9a-f]{40})', $res['guid'], $match);
        if ($match) {
            $link = 'magnet:?xt=urn:btih:' . $match[0];
            if ($btih == '') {
                $btih = $match[0];
            }
        }
    }
    $seedurl = $res['guid'];
    if ($USE_LOCAL_SEED == TRUE && $btih != '') {
        $seedurl = btih_seed_url($btih);
    }
    $popularity = '未知';
    if ($res['popularity'] >= 0) {
        $decays = (time() - $res['pmtime']) / 86400 / $POPULARITY_HALFLIFE_DAYS;
        $popularity = $res['popularity'] * pow(2, -1 * $decays);
        $popularity = round($popularity);
    }
    ?>
        <tr>
            <td class="pubDate"><?php 
    echo date('Y-m-d H:i:s', $res['pubDate']);
    ?>
</td>