陈德本 před 5 roky
rodič
revize
a0c08e8c4d
1 změnil soubory, kde provedl 8 přidání a 2 odebrání
  1. 8 2
      Baidu.php

+ 8 - 2
Baidu.php

@@ -13,7 +13,7 @@ use QL\QueryList;
 
 class Baidu implements PluginContract
 {
-    private $is_pc;
+    private $is_pc = true;
     protected $ql;
     protected $keyword;
     protected $pageNumber = 10;
@@ -38,6 +38,7 @@ class Baidu implements PluginContract
         ],
         'M' => [
             'title' => ['h3', 'text'],
+            'tpl' => ['', 'tpl'],
             'link' => ['', 'data-log']
         ],
     ];
@@ -85,7 +86,12 @@ class Baidu implements PluginContract
     {
         return $this->query($page)->query()->getData(function ($item) use ($realURL) {
             if (!$this->is_pc) {
-                $item['link'] = json_decode($item['link'], true)['mu'];
+                if ($item['tpl']!='www_normal'){
+                    return null;
+                }
+                $origin=json_decode($item['link'], true);
+                unset($item['tpl']);
+                $item['link'] = $origin['mu'];
             } else {
                 $realURL && $item['link'] = $this->getRealURL($item['link']);
             }