Hi Guys,
I tried couple of ini files for DSMART.COM.TR non of them work perfectly besides Blackbears199 PHP file. Normally I don't want to use my IIS Server for WebGrab but I couldn't find any solution. I hope someone can help me to keep maintained this ini file. For this reason I opened this topic. I made some improvments current test.ini (i changed dsmart.com.tr.ini)
What I want:
- I don't want to use php file if it is possible
- I want to update channel list in ini file.
Currently my lates ini file here:
site {url=dsmart.com.tr|timezone=UTC+03:00|maxdays=7|cultureinfo=tr-TR|charset=UTF-8|titlematchfactor=90}
site {episodesystem=onscreen}
*
url_index{url(debug)|http://127.0.0.1:83/test.php?channel=|channel|&date=|urldate|&reqtype=1}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
urldate.format {datestring|yyyy-MM-dd}
*
index_showsplit.scrub {multi|"schedule": [{||}]}|}]}}
scope.range{(splitindex)|end}
index_showsplit.modify {replace|\}, \{|\|}
index_showsplit.modify {sort(ascending,string)}
sort_by.scrub {single(target="index_showsplit")|"start_date": "||",|",}
sort_by.modify {calculate(target="index_showsplit" format=date,unix)}
index_showsplit.modify {(debug)} *for debug
end_scope
*
index_start.scrub {single|"start_date": "||Z"|Z"}
index_stop.scrub {single|"end_date": "||Z"|Z"}
index_title.scrub {single|"program_name": "||",|",}
index_description.scrub {single|"description": "||",|",}
index_description.modify {cleanup(style=jsondecode)}
index_category.scrub {single|"genre": "||",|",}
index_category.modify {cleanup(style=jsondecode)}
*
index_title.modify {cleanup(style=jsondecode)}
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
**
** @auto_xml_channel_start
*index_site_id.scrub {|}
*index_site_id.modify {set|1\|2}
*index_site_channel.modify {set|Televenezia\|Televenezia GT}
** @auto_xml_channel_end
I fixed it description and category fields. But I have no ide for channel creation section.
All channels here: https://www.dsmart.com.tr/actions/channels?page=1&limit=500
Example channel : https://www.dsmart.com.tr/actions/schedule?channel_id=58d29bb0eefad3db9c...
Channel line for my ini:
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c6062b6" xmltv_id="MovieSmart Türk HD">Movie Smart Türk</channel>
I need to get all site_id's. And I don't want to use PHP if it is possible. Thanks.
This lines generates new channel-list for DSMART.COM.TR
@auto_xml_channel_start
url_index {url|http://127.0.0.1:83/test.php?reqtype=3}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
index_site_id.scrub {multi|"_id": ||,|,}
index_site_id.modify {remove|"}
index_site_id.modify {remove(notnull type=string)|'}'}
index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
index_site_id.modify {cleanup(style=jsondecode)}
index_site_channel.scrub {multi|"channel_name": "||"|"}
index_site_channel.modify {cleanup(style=unidecode)}
@auto_xml_channel_end
I changed a little bit Blackbears199's php:
if($reqtype == '1') {
$channel = $_GET['channel'];
$date = $_GET['date'];
$url = "https://www.dsmart.com.tr/actions/schedule?channel_id=" . $channel . "&day=" . $date;
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
} elseif($reqtype == '2') {
$programid = $_GET['programid'];
$url = "https://www1.dsmart.com.tr/Page/Popup/TvGuide/ProgramDetail2.aspx?cacheID=" . $programid . "&bouquetID=&TrafficKey=" . $programid;
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Requested-With: XMLHttpRequest', 'Content-Length: ' . strlen($postdata)));
} elseif($reqtype == '3') {
$url = "https://www.dsmart.com.tr/actions/channels?page=1&limit=500";
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Requested-With: XMLHttpRequest', 'Content-Length: ' . strlen($postdata)));
}
I added bold lines. I attached updated dsmart.com.tr-channels.xml. Problem 2 fixed above. I need to fix first one. :)
New channel list similiar to this:
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c606260" xmltv_id="MovieSmart Gold HD">MovieSmart Gold HD</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c6062b6" xmltv_id="Da Vinci">Da Vinci</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c6062bd" xmltv_id="Viasat History HD">Viasat History HD</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c606259" xmltv_id="Star Tv HD">Star Tv HD</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c60624f" xmltv_id="Nhk">Nhk</channel>
If someone needs, updated test.php here:
I need help for above ini file. I can grab title desc and category but some channels doesnt have these fields for this reason KODI cannot display it. I need something like:
If desc is empty then create empty desc tag in XML file
If category is empty then create empty category tag in XML file
Thank you very much Blackbear199. You're right I don't need category & desc. I am facing with problem with DSMART. Could you help me to fix it?
I added these 3 channels to my config:
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c606247" xmltv_id="ATV Turkiye">ATV</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c606232" xmltv_id="Haberturk">HABERTURK</channel>
<channel update="i" site="dsmart.com.tr" site_id="58d29bb0eefad3db9c60628a" xmltv_id="Smart Sport HD">Smart Sport</channel>
Last one is OK but others I couldn't grab. For Haberturk data URL:
https://www.dsmart.com.tr/actions/schedule?channel_id=58d29bb0eefad3db9c...
It has data but I couldn' grab with your php. I don't know why.. But it is OK for Smart Sport.
Here is the ini that I use:
site {url=dsmart.com.tr|timezone=UTC|maxdays=7|cultureinfo=tr-TR|charset=UTF-8|titlematchfactor=90}
site {episodesystem=onscreen}
*
url_index{url(debug)|http://127.0.0.1:83/test.php?channel=|channel|&date=|urldate|&reqtype=1}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
urldate.format {datestring|yyyy-MM-dd}
*
index_showsplit.scrub {multi|"schedule": [{||}]}|}]}}
scope.range{(splitindex)|end}
index_showsplit.modify {replace|\}, \{|\|}
index_showsplit.modify {sort(ascending,string)}
sort_by.scrub {single(target="index_showsplit")|"start_date": "||",|",}
sort_by.modify {calculate(target="index_showsplit" format=date,unix)}
index_showsplit.modify {(debug)} *for debug
end_scope
*
index_start.scrub {single|"start_date": "||Z"|Z"}
index_stop.scrub {single|"end_date": "||Z"|Z"}
index_title.scrub {single|"program_name": "||",|",}
index_title.modify {cleanup(style=jsondecode)}
index_description.scrub {single|"description": "||",|",}
index_description.modify {cleanup(style=jsondecode)}
index_category.scrub {single|"genre": "||",|",}
index_category.modify {cleanup(style=jsondecode)}
Thanks.
Your ini file works perfectly with php file for DSMART. I just changed a little bit for channels file creation. I will share it with others who needs. This version supports new site_id's. Thank you very much for your great support. I will put all Turkish EPG sources together in new topic.
DSMART package includes special php file, channels list and ini.
Did you tested on Windows? It didn't work for me on Windows, I didn't test on my Raspberry Pi. Channel creation didn't work also. (on Windows). I am still using test.php which is made by Blackbear. He already working on it. We have some investigation about Dsmart you can check it here:
http://www.webgrabplus.com/content/updated-package-dsmart-hurriyet-trt-a...
Start reading from bottom.