<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Неофициальный форум DLNA Home Media Server &mdash; FS.life]]></title>
	<link rel="self" href="https://hms.lostcut.net/extern.php?action=feed&amp;tid=378&amp;type=atom" />
	<updated>2017-04-19T09:18:09Z</updated>
	<generator>PunBB</generator>
	<id>https://hms.lostcut.net/viewtopic.php?id=378</id>
		<entry>
			<title type="html"><![CDATA[FS.life]]></title>
			<link rel="alternate" href="https://hms.lostcut.net/viewtopic.php?pid=8771#p8771" />
			<content type="html"><![CDATA[<p>Здравствуйте может знающие подскажут что не так делаю, не получаю работающую ссылку на видео<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p>&lt;?php</p><p>// Входные параметры<br />$url&nbsp; = isset($_REQUEST[&#039;url&#039;]) ? $_REQUEST[&#039;url&#039; ] : &quot;&quot;;&nbsp; </p><p>if (!$url) die(&quot;No fs.life url in the parameters.&quot;);<br />$cookies = array();<br />$headers = &quot;Accept-Encoding: gzip, deflate, sdch\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Accept: application/json, text/javascript, */*; q=0.01\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,uk;q=0.2\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;X-Requested-With: XMLHttpRequest\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Connection: keep-alive\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Upgrade-Insecure-Requests:1\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Referer: &quot;.$url.&quot;\r\n&quot; .<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36\r\n&quot;;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />// Загружаем страницу выбираем озвучку</p><p>$page = LoadPage($url.&#039;?ajax&amp;folder=0&#039;, &quot;GET&quot;, $headers);<br />preg_match(&#039;#rel=&quot;{parent_id: \&#039;([^\&quot;]+)\&#039;.*}&quot;&gt;(.*)&lt;/a&gt;#Ui&#039;,$page,$maskat);<br />//Загружаем страницу c ссылками&nbsp; на видео<br />$video = LoadPage($url.&#039;?ajax&amp;folder=&#039;.$maskat[1], &quot;GET&quot;, $headers);</p><p>//получаем видео<br />preg_match(&#039;#href=&quot;(/get[^\&lt;]+)&quot;#Ui&#039;,$video,$link);</p><p>//Получаем прямую ссілку на видео <br />$url=preg_replace( &#039;#dl#Ui&#039;,&#039;playvideo&#039;,$link[1]);<br />$page = LoadPage(&#039;http://fs.life&#039;.$url.&#039;?json_link&#039;, &quot;GET&quot;, $headers);<br />$page = str_replace(&#039;\\&#039;, &#039;&#039;, $page);<br />preg_match(&#039;#&quot;link&quot;:&quot;([^\&quot;]+)&quot;#Ui&#039;, $page, $film);<br />//Не работает <img src="https://hms.lostcut.net/extensions/k_smiles/img/ac.gif" alt=":(" /><br />print_r($film[1]);</p><p>// Получение страницы с указанными методом и заголовками<br />function LoadPage($url, $method, $headers, $data=&#039;&#039;) {<br />&nbsp; &nbsp; $options = array();<br />&nbsp; &nbsp; $options[&#039;http&#039;] = array(&#039;method&#039; =&gt; $method ,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#039;header&#039; =&gt; $headers,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#039;content&#039;=&gt; $data&nbsp; &nbsp;);<br />&nbsp; &nbsp; $context = stream_context_create($options);<br />&nbsp; &nbsp; $page&nbsp; &nbsp; = file_get_contents($url, false, $context);<br />&nbsp; &nbsp; // Перебираем HTTP заголовки ответа<br />&nbsp; &nbsp; foreach($http_response_header as $c =&gt; $h) { if (stristr($h, &#039;content-encoding&#039;) and stristr($h, &#039;gzip&#039;)) { $page = gzdecode($page); } }<br />&nbsp; &nbsp; return $page;<br />}</p><p>?&gt;</p></div></div><p>Спасибо за помощь</p>]]></content>
			<author>
				<name><![CDATA[bond]]></name>
				<uri>https://hms.lostcut.net/profile.php?id=844</uri>
			</author>
			<updated>2017-04-19T09:18:09Z</updated>
			<id>https://hms.lostcut.net/viewtopic.php?pid=8771#p8771</id>
		</entry>
</feed>
