XMLTV - Script EPG Multi-Source

Discussion in 'TV-Server Plugins' started by azzuro, July 21, 2015.

  1. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    Hello,

    i do, today an small script based on msdos for download EPG data from internet.



    Download_EPG.bat
    Code (DOS):
    1.  
    2. REM Multi source Grabbing EPG V3 - from MediaPortal Software.
    3.  
    4. REM location
    5. SET source_path=C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv
    6. SET xmltv_path=C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv
    7. SET Wget=".\tools\wgetwin\wget.exe"
    8. SET Zip_tool=".\tools\unzip\unzip.exe"
    9. SET log_path=%source_path%\log
    10.  
    11. REM location of the EPG file
    12. SET EPG1_path=EPG1
    13. SET EPG2_path=EPG2
    14.  
    15. REM EPG1 source and filename
    16. REM URL from the source package
    17. SET Zip_WebSource1="http://"
    18. REM filename saved on your disk
    19. SET file_name_in_zip1=EPG1.zip
    20. REM Filename of the file present in the zip
    21. SET file_name_in_xml1=complet.xml
    22. REM filename output wanted
    23. SET file_name_ou_xml1=EPG1.xml
    24.  
    25. REM EPG2 source and filename
    26. SET Zip_WebSource2="http://"
    27. SET file_name_in_zip2=EPG2.zip
    28. SET file_name_in_xml2=tvguide.xml
    29. SET file_name_ou_xml2=EPG2.xml
    30.  
    31. REM Log setting
    32. SET Log_name=Grabbing_%Date:~-4% %Date:~-7,-5% %Date:~-10,-8%_%Time:~-11,-9% %Time:~-8,-6% %Time:~-5,-3%.log
    33. SET Keep_file=2
    34.  
    35. cd "%source_path%"
    36. REM Keep the last log files set to "Keep_file"
    37.  
    38. for /f "skip=%Keep_file% eol=: delims=" %%F in ('dir /b /a-d /o-d *.log') do del "%%F"
    39.  
    40. Echo EPG grabbing Version 2 '28/07/2015' >> "%Log_name%"
    41. Echo Grabbing EPG Started - %Date:~-4%/%Date:~-7,-5%/%Date:~-10,-8% %Time:~-11,-9%:%Time:~-8,-6%:%Time:~-5,-3% >> "%Log_name%"
    42. Echo. >> "%Log_name%"
    43. Echo __________________________________________________________________ >> "%Log_name%"
    44.  
    45. REM : Create folder for download the EPG, WGet contain bug because don't create the folder.
    46. mkdir %EPG1_path% >> "%Log_name%"
    47. mkdir %EPG2_path% >> "%Log_name%"
    48.  
    49. Echo. >> "%Log_name%"
    50. Echo download EPG Source file >> "%Log_name%"
    51. Echo. >> "%Log_name%"
    52.  
    53. %Wget% -x -O "%source_path%/%EPG1_path%/%file_name_in_zip1%" -a "%source_path%/%Log_name%" %Zip_WebSource1%
    54. %Wget% -x -O "%source_path%/%EPG2_path%/%file_name_in_zip2%" -a "%source_path%/%Log_name%" %Zip_WebSource2%
    55.  
    56. REM Unzip the XML EPG, if zipped
    57. %Zip_tool% -o "%source_path%\%EPG1_path%\%file_name_in_zip1%" -d "%source_path%\%EPG1_path%" >> "%Log_name%"
    58. %Zip_tool% -o "%source_path%\%EPG2_path%\%file_name_in_zip2%" -d "%source_path%\%EPG2_path%" >> "%Log_name%"
    59.  
    60. REM Delete previous EPG XML file available inside the dedicated EPG folder, and rename the new one.
    61. del "%source_path%\%EPG1_path%\%file_name_ou_xml1%" >> "%Log_name%"
    62. rename "%source_path%\%EPG1_path%\%file_name_in_xml1%" "%file_name_ou_xml1%" >> "%Log_name%"
    63.  
    64. REM Delete previous EPG XML file available inside the dedicated EPG folder, and rename the new one.
    65. del "%source_path%\%EPG2_path%\%file_name_ou_xml2%" >> "%Log_name%"
    66. rename "%source_path%\%EPG2_path%\%file_name_in_xml2%" "%file_name_ou_xml2%" >> "%Log_name%"
    67.  
    68. REM copy the both XML EPG to the XMLTV path
    69. Echo. >> "%Log_name%"
    70. copy /Y "%source_path%\%EPG1_path%\%file_name_ou_xml1%" "%xmltv_path%\%file_name_ou_xml1%" >> "%Log_name%"
    71. copy /Y "%source_path%\%EPG2_path%\%file_name_ou_xml2%" "%xmltv_path%\%file_name_ou_xml2%" >> "%Log_name%"
    72.  
    73. Echo. >> "%Log_name%"
    74. Echo Grabbing Finished - %Date:~-4%/%Date:~-7,-5%/%Date:~-10,-8% %Time:~-11,-9%:%Time:~-8,-6%:%Time:~-5,-3% >> "%Log_name%"
    75.  
    tvguide.lst
    Code (Text):
    1. EPG1.xml
    2. EPG2.xml
    V3: 13/01/2016
    solve few error in path.

    V2 - 28/07/2015
    - modified the unzip program FBzip > unzip Msdos '"PKUnzip"
    - EPG are stored in their own folder.
    - add Log file, with the last 3 files available.
     

    Attached Files:

    Last edited: January 13, 2016
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Already done for TVE 3.5. I'm not going to do it for TVE 3.
     
    • Like Like x 2
  4. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    not a problem, my question was for TVE 3.5
    Thank you ;)
     
  5. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    Post 1 updated;

    new Script. more complex :sick:
     
    • Funny Funny x 1
  6. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    bah pour la peine, j'en remet une couche ! lol

    Update to V3 for solve few error of "CODING" :ROFLMAO:
     
    • Thank You! Thank You! x 1
  7. LoDeNo

    LoDeNo Portal Pro

    Joined:
    February 19, 2009
    Messages:
    314
    Likes Received:
    51
    Ratings:
    +65 / 0
    Home Country:
    France France
    Show System Specs
  8. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
  9. LoDeNo

    LoDeNo Portal Pro

    Joined:
    February 19, 2009
    Messages:
    314
    Likes Received:
    51
    Ratings:
    +65 / 0
    Home Country:
    France France
    Show System Specs
    C'est là dedans qu'on met l'URL, à la place du http:// ?
    REM URL from the source package
    SET Zip_WebSource1="http://"
     
  10. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    Oui msieur.
    Mais attention il faut indiquer le nom du fichier qui se trouve dedans
     
    • Thank You! Thank You! x 1
  11. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,520
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    For information
    the source path correspond at the directory where all files are saved from script
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!