Resource icon

[Ice] LiveStreams 1.3

No permission to download
I get this error on xenforo.


Code:
ErrorException: file_get_contents(http://api.justin.tv/api/stream/list.json?channel=1111winter4w) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway - library/Ice/EmbedStreams/Model/Streams.php:38
Generated By: Unknown Account, 1 minute ago
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'file_get_conten...', '/home/animalcr/...', 38, Array)
#1 /home/animalcr/public_html/forum/library/Ice/EmbedStreams/Model/Streams.php(38): file_get_contents('http://api.just...')
#2 /home/animalcr/public_html/forum/library/Ice/EmbedStreams/CronEntry/LiveStreams.php(5): Ice_EmbedStreams_Model_Streams->cronStreamsUpdate()
#3 [internal function]: Ice_EmbedStreams_CronEntry_LiveStreams::updateLiveStreams(Array)
#4 /home/animalcr/public_html/forum/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array)
#5 /home/animalcr/public_html/forum/library/XenForo/Deferred/Cron.php(22): XenForo_Model_Cron->runEntry(Array)
#6 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(198): XenForo_Deferred_Cron->execute(Array, Array, 9.99999713898, '')
#7 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(321): XenForo_Model_Deferred->runDeferred(Array, 9.99999713898, '', false)
#8 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(274): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#9 /home/animalcr/public_html/forum/deferred.php(18): XenForo_Model_Deferred->run(false)
#10 {main}
Request State
array(3) {
  ["url"] => string(42) "http://forum.animal-craft.net/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(10) "/index.php"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
I get this error on xenforo.


Code:
ErrorException: file_get_contents(http://api.justin.tv/api/stream/list.json?channel=1111winter4w) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway - library/Ice/EmbedStreams/Model/Streams.php:38
Generated By: Unknown Account, 1 minute ago
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'file_get_conten...', '/home/animalcr/...', 38, Array)
#1 /home/animalcr/public_html/forum/library/Ice/EmbedStreams/Model/Streams.php(38): file_get_contents('http://api.just...')
#2 /home/animalcr/public_html/forum/library/Ice/EmbedStreams/CronEntry/LiveStreams.php(5): Ice_EmbedStreams_Model_Streams->cronStreamsUpdate()
#3 [internal function]: Ice_EmbedStreams_CronEntry_LiveStreams::updateLiveStreams(Array)
#4 /home/animalcr/public_html/forum/library/XenForo/Model/Cron.php(356): call_user_func(Array, Array)
#5 /home/animalcr/public_html/forum/library/XenForo/Deferred/Cron.php(22): XenForo_Model_Cron->runEntry(Array)
#6 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(198): XenForo_Deferred_Cron->execute(Array, Array, 9.99999713898, '')
#7 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(321): XenForo_Model_Deferred->runDeferred(Array, 9.99999713898, '', false)
#8 /home/animalcr/public_html/forum/library/XenForo/Model/Deferred.php(274): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#9 /home/animalcr/public_html/forum/deferred.php(18): XenForo_Model_Deferred->run(false)
#10 {main}
Request State
array(3) {
  ["url"] => string(42) "http://forum.animal-craft.net/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(10) "/index.php"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}


I get the same error and nothing is showing up on my steam page. Any help will be appreciated.
 
Hello. I installed the add on and added 19 streams to it but they are not showing live on the forum. Two of the users were streaming live but it never updated and showed them (waited over 30 minutes). What could be wrong?
 
Is it just me that cant make it work

Code:
file_get_contents(http://api.justin.tv/api/stream/list.json?channel=iKasperr): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
1.XenForo_Application::handlePhpError()
2.file_get_contents() in C:\xampp\htdocs\library\Ice\EmbedStreams\Model\Streams.php at line 38
3.Ice_EmbedStreams_Model_Streams->cronStreamsUpdate() in C:\xampp\htdocs\library\Ice\EmbedStreams\CronEntry\LiveStreams.php at line 5
4.Ice_EmbedStreams_CronEntry_LiveStreams::updateLiveStreams()
5.call_user_func() in C:\xampp\htdocs\library\XenForo\Model\Cron.php at line 356
6.XenForo_Model_Cron->runEntry() in C:\xampp\htdocs\library\XenForo\ControllerAdmin\Cron.php at line 213
7.XenForo_ControllerAdmin_Cron->actionRun() in C:\xampp\htdocs\library\XenForo\FrontController.php at line 347
8.XenForo_FrontController->dispatch() in C:\xampp\htdocs\library\XenForo\FrontController.php at line 134
9.XenForo_FrontController->run() in C:\xampp\htdocs\admin.php at line 13
 
with cron error, its because justin.tv no longer exists you need to change the API link in the streams.php file this can be found in /library/Ice/EmbedStreams/Model directory

From
Code:
'http://api.justin.tv/api/stream/list.json?channel='
to
Code:
'https://api.twitch.tv/kraken/streams/list.json?channel='
 
I figured out how to fix it,

In /library/Ice/EmbedStreams/Model/Streams.php

Replace line 36 to 46 with this:

Code:
case 0:
                    $url = 'https://api.twitch.tv/kraken/streams/'.$stream['stream_username'];
                    $content = file_get_contents($url);
                    $json = json_decode($content, true);
                        if($json['stream']){
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>1), "`stream_id`=".$stream['stream_id']);
                        $online++;
                        }else{
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>0), "`stream_id`=".$stream['stream_id']);
                        }
                    break;
 
I figured out how to fix it,

In /library/Ice/EmbedStreams/Model/Streams.php

Replace line 36 to 46 with this:

Code:
case 0:
                    $url = 'https://api.twitch.tv/kraken/streams/'.$stream['stream_username'];
                    $content = file_get_contents($url);
                    $json = json_decode($content, true);
                        if($json['stream']){
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>1), "`stream_id`=".$stream['stream_id']);
                        $online++;
                        }else{
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>0), "`stream_id`=".$stream['stream_id']);
                        }
                    break;
This worked perfectly! Thanks for posting it
 
I figured out how to fix it,

In /library/Ice/EmbedStreams/Model/Streams.php

Replace line 36 to 46 with this:

Code:
case 0:
                    $url = 'https://api.twitch.tv/kraken/streams/'.$stream['stream_username'];
                    $content = file_get_contents($url);
                    $json = json_decode($content, true);
                        if($json['stream']){
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>1), "`stream_id`=".$stream['stream_id']);
                        $online++;
                        }else{
                        $this->_getDb()->update("xf_ice_livestreams", array('live'=>0), "`stream_id`=".$stream['stream_id']);
                        }
                    break;
Nice thanks you !
 
Top Bottom