Welcome to Media Center Master!
A powerful solution for mastering your digital media library.
Supporting Emby, Kodi/XBMC/OSMC, Plex, Windows Media Center, and more!

Home Download Gallery Wiki Issue Tracker Licensing Forums

   FAQ  •  Search •  Login •  Register     
It is currently December 15th, 2017, 4:06 am

All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: Automatically add your media to iTunes
PostPosted: January 26th, 2014, 12:16 pm 
Offline
Xvid Movie

Joined: February 19th, 2013, 7:30 pm
Posts: 30
Location: Sechelt, Canada
can someone help me make the addtoitunes.vbs automatically add the content rating to the itunes video file. I gave it a go and I don't really know what I am doing. if someone could do it and then i can copy and paste would be awesome.


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: March 26th, 2014, 2:10 pm 
Offline
Xvid Movie

Joined: February 19th, 2013, 7:30 pm
Posts: 30
Location: Sechelt, Canada
can someone get me in touch with the person who made this scripts. addtoitunes. or someone that know Vb scripting. I am willing to pay for the time needed to customize the scripts.


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: July 11th, 2014, 9:24 am 
Offline
Downloaded Clip

Joined: July 11th, 2014, 9:12 am
Posts: 3
Hello Community,

I have been an MCM licenced user for 3 years. Been using this wonderful script for 2 years with no trouble (thank you!!).

Recent re-install of Win8.1 and the addtoitunes script is no longer adding the file to iTunes. The script runs as normal, no error messages - the conversion CMD box runs and iTunes flashes in the background but the file does not go into iTunes.

If I manually select through iTunes (add file to library). It adds not problem with all the metadata picked up from the script..

Any ideas?


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: July 13th, 2014, 11:50 pm 
Offline
Developer/Owner
User avatar

Joined: May 1st, 2009, 10:12 am
Posts: 11315
Location: Meridian, ID, USA
Try turning off UAC elevation for Media Center Master.

_________________
Peter Souza IV
stable version 2.16.11117.1299 / April 21st, 2017
Media Center Master on Facebook!


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: July 14th, 2014, 2:43 am 
Offline
Downloaded Clip

Joined: July 11th, 2014, 9:12 am
Posts: 3
Thanks Peter,

That is already off. I also tried starting as Administrator.

Did a couple more tests, and it converts an MKV, AVI etc but just doesn't add it to iTunes.

Cheers...


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: February 23rd, 2015, 10:34 pm 
Offline
Downloaded Clip

Joined: February 23rd, 2015, 10:28 pm
Posts: 1
Does anybody have a copy of the command file that needs to be added to the Media Center Master directory? The link in the original post no longer works. Perhaps attach it here or provide an upload somewhere else? Much appreciated!


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: October 26th, 2015, 12:46 pm 
Offline
Flash Video

Joined: October 26th, 2015, 12:41 pm
Posts: 24
Hi Guys

Sorry to bump this thread, but can anyone point me to a working location of the script files, specifically the .cmd file.

I've been demoing this software for about 2 weeks now, and I'm sold. Definately going to buy it. Even my wife thinks it's awesome that it just does everything for her!

Thanks for the great app!


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: October 27th, 2015, 6:43 am 
Offline
DVD VOB

Joined: November 4th, 2012, 4:15 am
Posts: 97
Hi There

My Command File: addtoitunes.cmd

REM @echo off
"C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Media Center Master\addToItunes.vbs" %1 %2 %3 %4 %5 %6 %7 %8 %9


My VBS File (that I have in my own amateur way hacked around to get it to do what I want it to, definitely could be optimised) addToItunes.vbs

' addToiTunes.vbs v1.2 - 21-11-2012
' This script developed by Darren Blackley, Copyright 2012 - all rights reserved.
' You may use this script freely provided you leave this information in tact and complete.

' This script will check your media files and if compatiable inject itunes compatiable metadata
' in the the media and then add the file to iTunes (providing it is installed). If the media is
' not compatiable, it will convert the media to a m4v file and then process as outlined above.

' For this script to work, you will require the following fre1e tools;
' HandbrakeCLI for windows - http://handbrake.fr/downloads2.php (to convert to m4v)
' AtomicParsley for Windows - https://bitbucket.org/jonhedgerows/atom ... /downloads (to inject the metadata directly)

' MCM Variables for Post-Processing;
' - Enable Movie Post-Processing - %V %S %T %Y
' - Enable TV Episode Post-Processing - %V %S %T %AD %ET %SE %EP %SE2 %EP2 %CR

Option Explicit
On Error Resume Next
Dim objShell, objFSO, iTunesLibrary, xmlDoc, toolsPath, intReturn
Dim Q2, theFile, theMediaType, theTitle, theAiredDate, theEpisodeTitle, theSeasonNum, theEpisodeNum, theSeasonNum2, theEpisodeNum2, theCoverArt, aCommand, theDescription, hCommand
Dim theContentRating

' set the required variables for all.
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colNamedArguments = WScript.Arguments.Named

'Set iTunesLibrary = WScript.CreateObject("iTunes.Application").LibraryPlaylist
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
Q2 = Chr(34)

' change this to suit where the tools are installed
toolsPath = "C:\Program Files (x86)\Media Center Master\"

' the imput variables - from command line or MCM
theFile = WScript.Arguments(0) ' get the absolute file path
'theFile = colNamedArguments.Item("The File")

if LCase(WScript.Arguments(1)) = "episode" then ' check if TV show or Movie and set the media type
theMediaType = "TV Show"
else
theMediaType = "Movie"
end if

theTitle = WScript.Arguments(2) ' set the media title

if theMediaType = "TV Show" then ' set aired date to right format for TV Show or Movie
if WScript.Arguments(3) = "" then ' if no aired date - set to now...
theAiredDate = Year(Now())&"-"& Month(Now())&"-"& Day(Now())&"T"& Hour(Now())&":"& Minute(Now())
else
theAiredDate = WScript.Arguments(3)
end if
elseif theMediaType = "Movie" then
if wscript.arguments(3) = "" then ' if no year - set to now...
theAiredDate = Year(Now())
else
theAiredDate = wscript.arguments(3)
end if
end if

theEpisodeTitle = WScript.Arguments(4) ' Set the TV Episode title
theSeasonNum = WScript.Arguments(5) ' Set the single digit season number
theEpisodeNum = WScript.Arguments(6) ' Set the single digit episode number
theSeasonNum2 = WScript.Arguments(7) ' Set the two digit season number
theEpisodeNum2 = WScript.Arguments(8) ' Set the two digit episode number
theContentRating = WScript.Arguments(9) ' Set the Content Rating
'theContentRating = WScript.Arguments.Count
theCoverArt = objFSO.GetParentFolderName(theFile) & "\folder.jpg" ' set the coverart

' Get the Movie synopis/Description from the title from movie.xml/<title>.nfo file
if theMediaType = "Movie" then
if objFSO.FileExists(objFSO.GetParentFolderName(theFile) & "\movie.xml") then
xmlDoc.load(objFSO.GetParentFolderName(theFile) & "\movie.xml")
theDescription = xmlDoc.GetElementsByTagName("Description").item(0).text
elseif objFSO.FileExists(objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".nfo") then
xmlDoc.load(objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".nfo")
theDescription = xmlDoc.GetElementsByTagName("plot").item(0).text
end if
' Get the TV Show synopis/Overview from the title from <title>.xml/<title>.nfo file
elseif theMediaType = "TV Show" then
if objFSO.FileExists(objFSO.GetParentFolderName(theFile) & "\metadata\" & objFSO.GetBaseName(theFile) & ".xml") then
xmlDoc.load(objFSO.GetParentFolderName(theFile) & "\metadata\" & objFSO.GetBaseName(theFile) & ".xml")
theDescription = xmlDoc.GetElementsByTagName("Overview").item(0).text
elseif objFSO.FileExists(objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".nfo") then
xmlDoc.load(objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".nfo")
theDescription = xmlDoc.GetElementsByTagName("plot").item(0).text
end If

else
theDescription = "No synopis found..."
end if

' *** do the business! ***
' Check the file type and if not iTunes compatible - process as required.
if objFSO.FileExists(theFile) then
if WScript.Arguments.length > 0 then
Select Case objFSO.GetExtensionName(theFile)
Case "m4v"
call addMetadata
objFSO.Copyfile thefile,"I:\ITunes_Music\iTunes Media\Automatically Add to iTunes\"
Case "mkv"
call MikeMKvExtract
Call addMetadata
objFSO.Copyfile thefile,"I:\ITunes_Music\iTunes Media\Automatically Add to iTunes\"
Case "mp4"
call convertFile
Call addMetadata
objFSO.Copyfile thefile,"I:\ITunes_Music\iTunes Media\Automatically Add to iTunes\"
Case Else
call convertFile
call addMetadata
objFSO.Copyfile thefile,"I:\ITunes_Music\iTunes Media\Automatically Add to iTunes\"
end select
else
intReturn = objShell.Popup("No Media Filename Available - Nothing to add!" & chr(13) & chr(13) &"Correct Syntax to use: addToiTunes.vbs ""[path]<mediafilename>""",10,"No Media File Found!",64) 'automatically closes after 5 seconds
end If
else
intReturn = objShell.Popup("Specified file does not exist!" & chr(13) & chr(13) & "Check: """ & theFile & """",10,"No File Found",16) 'automatically closes after 5 seconds
end If

'intReturn = objShell.Popup("Operation Complete",5,"All Done!",64) 'automatically closes after 5 seconds
wscript.quit
' *** end the business! ***

' inject the metadata for itunes
function addMetadata
aCommand = Q2 & toolsPath & "AtomicParsley.exe" & Q2 & " " & Q2 & theFile & Q2 & " --stik " & Q2 & theMediaType & Q2 ' set base command line

if theMediaType = "TV Show" then
aCommand = aCommand & " --title " & Q2 & theEpisodeTitle & Q2
else
aCommand = aCommand & " --title " & Q2 & theTitle & Q2
end if

if not theAiredDate = "" then ' add the aired date to command line
aCommand = aCommand & " --year " & Q2 & theAiredDate & Q2
end if

if not theEpisodeTitle = "" then ' add the episode title to the command line (tv shows only)
aCommand = aCommand & " --artist " & Q2 & theTitle & Q2 & " --TVShowName " & Q2 & theTitle & Q2 & " --albumArtist " & Q2 & theTitle & Q2
end if

if not theSeasonNum = "" then ' add the season number to command line (tv shows only)
aCommand = aCommand & " --TVSeasonNum " & theSeasonNum & " --disk " & theSeasonNum
end if

if not theEpisodeNum = "" then ' add the episode number to command line (tv shows only)
aCommand = aCommand & " --TVEpisodeNum " & theEpisodeNum & " --tracknum " & theEpisodeNum
end if

if not ((theSeasonNum2 = "") or (theEpisodeNum2 = "")) then ' add the season (two digit) and episode (two digit) numbers to command line (tv shows only)
aCommand = aCommand & " --TVEpisode " & Q2 & theTitle & " - " & "S" & theSeasonNum2 & "E" & theEpisodeNum2 & " - " & theEpisodeTitle & Q2
end if

if not ((theTitle = "") or (theSeasonNum = "")) then ' add the season (two digit) and episode (two digit) numbers to command line (tv shows only)
aCommand = aCommand & " --album " & Q2 & theTitle & ", Season " & theSeasonNum & Q2
end if



if objFSO.FileExists(objFSO.GetParentFolderName(theFile) & "\folder.jpg") then ' check for folder.jpg in the folder and if found add to command line
aCommand = aCommand & " --artwork " & Q2 & objFSO.GetParentFolderName(theFile) & "\folder.jpg" & Q2
end if

aCommand = aCommand & " --description " & Q2 & Left(theDescription,250) & "..." & Q2 & " --longdesc " & Q2 & theDescription & Q2 ' add description to command line
aCommand = aCommand & " --comment " & Q2 & "Details added " & Date() & " by addToiTunes - developed by Darren Blackley." & Q2

'if not theContentRating = "" then ' add the Content Rating
aCommand = aCommand & " --contentRating " & Q2 & theContentRating & Q2
'end

aCommand = aCommand & " --overWrite" ' add overwrite media to command line (if not added will create new file)

objShell.Run aCommand,7,true
wscript.echo aCommand
end function

' convert to itunes compatiable universal format.
function convertFile
hCommand = Q2 & toolsPath & "handbrakecli.exe" & Q2 & " -i " & Q2 & theFile & Q2 & " -o " & Q2 & objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".m4v" & Q2 & " --preset=" & Q2 & "AppleTV 3" & Q2
objShell.Run hCommand,7,true
objFSO.MoveFile theFile, objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & objFSO.GetExtensionName(theFile) &".bak"
theFile = objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) &".m4v"
end function

function MikeMKvExtract
hCommand = Q2 & toolsPath & "ffmpeg.exe" & Q2 & " -i " & Q2 & theFile & Q2 & " -strict experimental -vcodec copy -map 0:0 -map 0:1 -map 0:1 -c:1 aac -ac 2 -c:2 copy -sn " & Q2 & objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & ".m4v" & Q2


objShell.Run hCommand,7,true
objFSO.MoveFile theFile, objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) & objFSO.GetExtensionName(theFile) &".bak"

theFile = objFSO.GetParentFolderName(theFile) & "\" & objFSO.GetBaseName(theFile) &".m4v"
end function




Regards

MikeP


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: October 28th, 2015, 2:15 am 
Offline
Flash Video

Joined: October 26th, 2015, 12:41 pm
Posts: 24
Awesome thanks!!!


 Profile  
 Post subject: Re: Automatically add your media to iTunes
PostPosted: April 26th, 2016, 3:55 am 
Offline
Flash Video

Joined: October 26th, 2015, 12:41 pm
Posts: 24
Hi Mike

Thanks again for this awesome script, it been workeing great for me. Unfortunately there is one hiccup, since most of the TV Episodes are coming out in mkv format, ffmpeg needs to convert them. The problem is that the sound is tinny (has a slight echo). Do you perhaps have some advise on the command line options I can use to fix this?

Thanks!


 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group



Copyright © 2009-2017, Media Center Master, Inc. All rights reserved.