Jump to content

samuel90

Members
  • Posts

    16
  • Joined

  • Last visited

samuel90's Achievements

Member

Member (2/5)

0

Reputation

  1. I have goood news ​Somehow the PDO does not work with my free host provider or I do something wrong, but I used the old MySQL string to establish connection. ​Ok the script now works, it loads the XML and exports the Channel Name and Channel URL to my database, and with the Primary Key set to Channel Name it now updates the URLs in the database. I manipulated the URLs on purpose to see if it does update, and yeah finally it works So now what should be done to update the URLs periodically or only when the XML is updated, and how to link the URL in the database with the one in my playlist? Let's name the file Link_update.php in which the working script is now
  2. No I try new Scripts in a new file, because if i add it to the old one I would mess everything up, so what does this phpinfo exactly do?
  3. OMG, its a nightmare, coding is way more complicated then I thought. ​OK, so where to put that script? Create a new php file? And access it from IE browser? ​
  4. ​For you it might be very easy this thing, but for me it is really complicated. I was so fu**ing happy when I made it load the xml content to the database, and then I should better use PDO, which seems not to work for me. All I do is COPY and PASTE and of course try to understand what's written and replace some values with my values. I look like 5-6 different pages and try their method but my success rate ist too low. And the other problem ist, I don't really know for what to google. I googled like one week till I found the first script I posted, and now passes another week google-ing and results are not very pleasant, as always very different from each other. ​I'm really thankful to you trying to help me, and I would totally understand if you don't want to loose more time to reply to my issues here
  5. I have no idea, down there it says there is a new version, but cant find a way to update.
  6. Trying to connect with PDO I only get errors <?php $host = "localhost"; $user = "1301168"; $pass = "*****"; $db = "1301168"; try { $conn = new PDO("mysql:host=$host;dbname=$db", $user, $pass); echo "Connected to $db at $host successfully."; } catch (PDOException $pe) { die("Could not connect to the database $db :" . $pe->getMessage()); } ?> Error: Parse error: syntax error, unexpected '$conn' (T_VARIABLE) in /home/vhosts/mili.freeoda.com/test4.php on line 9 I have nothing else in the Script, and it does not work
  7. I just messed up the whole script, nothing works. ​as for primary key, after 2hours trying I think I made it on channel title. I feel really dumb, The PDO and your script ist just confusing when compared to the one I got working last.
  8. I really apreciate your Help, but Im not able to see an end of this puzzle since I would have probably to learn all about Programming till I get what I want ​I thought It would be a simple short script that just does the job for me, but now Im spending too much trying to find some appropriate script which I then put together by try & fail method. ​Thanks again for your help
  9. Just before I was about to give up, I have found something maybe usefull. So, I found a script that loads the XML and inserts channel_name and channel_link to my database ​The script looks like this: <?php $con = mysql_connect("localhost","user","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("user", $con); $mytv = "http://http://xml.provider.com/all.php"; if(!$xml=simplexml_load_file($mytv)){ trigger_error('Error reading XML file',E_USER_ERROR); } foreach ($xml as $channel) { $title = $channel->title; $link = $channel->url; $sql="INSERT INTO mytvdb (channel_name, channel_url) VALUES ('$title','$link')"; $query = mysql_query($sql); if (!$query) { echo ('Error: ' . mysql_error()); } else { echo "Record added"; } } mysql_close($con) ?> I did the script in a new file for test purpose, so it should remain a separate file or? ​Every time I run the script it adds the data to the database, so I get the data double, triple and so on, so is it right way?
  10. Ok I understand, but when I open the the developer tools in Microsoft Edge and Chrome also, Im not able to find what you mean. My providers XML is: xml.tvmak.com/all.php
  11. A period of 30minutes could do the job, or the one with Last-Modified​ or ETag sounds great too, but I have no idea if my free server has something like that, how can I find out? I'll try google first, and see what I get. ​This Last-Modified thing is for SQL right? ​when I visit my server from IE i get this:
  12. That is true, the URLs don't change every minute, but I don't know when they change, so periodical scan would bring some issues with if for e.g. the period is every 2h do a scan and update Links if there is change, but what if an URL changes right after the scan, so that channel would be offline for the next 2 hours, right? ​The playlist is loaded every time I start the PerfectPlayer in my Android device, so maybe its possible to do it like every time the playlist loads, it runs the script, updates the channels in the database. And in the playlist the channels URL are the one stored in the database?! I've heard of MySQL, but never worked with it, so for this I would have to look for some tutorials though. ​I really like your idea of storing the URLs somewhere and let them be updated by the script, but to be honest I have no idea how to approach this. Maybe I should look locally for someone who could help me coding.
  13. this one seems to be less confusing. But Im really confused with the Script you suggested http_build_query. As far as I understand the XML list, every channel child has an TITLE and LOCATION tab, so whenever my created stream URL for e.g.: /my.php?channel=TV+Channel+08 is launched, it runs the PHP script, which loads the XML, finds the channel child with TITLE containing TV Channel 08, picks up the URL from LOCATION tab and responds to Player for playback ​I really appreciate your help, but as a noob I'm really confused what to add to my script and where
  14. @requinix thank you very much for the code, I tried it and it gives numbers, but I dont know if the number given for Channel 1 will always be the same and wont change, I also did not have success with the player. ​There are like 15 Channels, I can do this for all its not a problem for me, but somehow I don't understand how the code works, and what it does?! ​@Jacques1 Using channel name would be probably better, but since there space between, I thought it wont work. I don't mind if the stream URL is not pretty, if it works. ​So, how should the code be when the URL in my playlist would look like: http://mywebhost.com/my.php?get=channel-N
  15. Hello everyone, first of all I want to apologise if I posed in wrong place. Now to my concern. I'm not a programmer but have some basic know how from school time when I learned HTML, CSS, JavaScript and so on. I have a problem and after 1 week google research I have come to somewhere but not to a solution. Therefore I hope I'll get some Help here. My IPTV Provider hands me the Stream URLs by XML which looks like this: <?xml version="1.0" encoding="UTF-8"?> <channels> <channel> <title>TV Channel 1</title> <img>http:/stream.url/channel-logo.png</img> <info></info> <url>http:/stream.url/channel.m3u8</url> </channel> <channel> <title>TV Channel 2</title> <img>http:/stream.url/channel2-logo.png</img> <info></info> <url>http:/stream.url/channel2.m3u8</url> </channel> ... </channels> Now I have created my own Playlist .m3u8 with my favorite channels, since there are a lot of them and I don't want to have all of them. My Provider changes sometimes the stream url so I have allways to replace the URL manualy. Now I thought I could have a PHP stream link like: http://mywebhost.com/myphp?channel=id. My PHP code for now looks like this: (after 1 week of research, finally the Code gets the content from XML and shows Channel-name and URL) <?php $html = ""; $mytv = "http://xml.provider.com/all.php"; $xml=simplexml_load_file($mytv); for($i = 0; $i < 200; $i++){ $title = $xml->channel[$i]->title; $link = $xml->channel[$i]->url; $html .= "<p>$title</p><p>$link</p>"; } echo $html; ?> Now I want to give each Channel and ID wich can be a 2 Digit number, so that my stream URL would be like this http://mywebhost.com/myphp?channel=id or similar or even better way. Here ist your help needed, how can I give ID number to all channels, and get the dedicated stream URL as a return for my VLC player in PC and PerfectPlayer in Android device?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.