XaF / TraktForVLC

Automatically trakt.tv what you're watching on VLC
300 stars 49 forks source link

[macOS 10.12.5] Can't launch org.TraktForVLC.plist #72

Closed Francis2b closed 7 years ago

Francis2b commented 7 years ago

Hi,

I have some troubles to launch org.TraktForVLC.plist. Type in Terminal:

launchctl load ~/Library/LaunchAgents/org.TraktForVLC.plist

but nothing happens

Here my plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.user.TraktForVLC</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</string>
        <string>/Users/Francois/TraktForVLC/TraktForVLC.py</string>
    </array>
    <key>WorkingDirectory</key>
    <string>/Users/Francois/TraktForVLC</string>
    <key>RunAtLoad</key>
    <true />
    <key>LaunchOnlyOnce</key>
    <true />
    <key>KeepAlive</key>
    <true />
</dict>
</plist>

Here what is displayed when I do a launchctl list

Francoiss-MacBook-Pro:~ Francois$ launchctl load /Users/Francois/Library/LaunchAgents/org.TraktForVLC.plist
Francoiss-MacBook-Pro:~ Francois$ launchctl list
PID Status  Label
26880   0   com.apple.quicklook
-   0   com.apple.parentalcontrols.check
2742    0   com.apple.Finder
26151   0   com.apple.xpc.launchd.oneshot.0x100000fc.TextEdit
-   0   com.apple.PackageKit.InstallStatus
2915    0   com.apple.mediaremoteagent
-   0   com.apple.FontWorker
2750    0   com.apple.bird
-   0   com.apple.familycontrols.useragent
15347   0   com.apple.mail.19636
-   0   com.apple.universalaccessAuthWarn
2777    0   com.apple.nsurlsessiond
2834    0   com.bjango.istatmenusagent
-   0   com.apple.syncservices.uihandler
2835    0   com.apple.iconservices.iconservicesagent
2917    0   com.apple.ContactsAgent
-   0   com.apple.ManagedClientAgent.agent
-   0   com.apple.screensharing.agent
26894   0   com.apple.Terminal.19792
-   0   com.apple.TMHelperAgent.SetupOffer
-   0   com.apple.AddressBook.SourceSync
-   0   com.apple.languageassetd
-   0   com.apple.familynotificationd
2865    0   com.apple.photolibraryd
-   0   com.apple.cfnetwork.cfnetworkagent
-   0   com.apple.xpc.otherbsd
-   0   com.apple.sysdiagnose_agent
-   0   com.apple.universalaccessHUD
-   0   com.apple.bluetoothUIServer
2914    0   com.apple.assistant_service
-   0   com.apple.touristd
-   0   com.apple.MRTa
2728    0   com.apple.CommCenter
291 0   com.apple.trustd.agent
-   0   com.apple.MailServiceAgent
4186    0   com.apple.appkit.xpc.sandboxedServiceRunner
-   0   com.apple.mdworker.mail
-   0   com.apple.mdworker.single.02000000-0000-0000-0000-000000000000
26580   255 com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000
-   0   com.apple.cvmsCompAgent3425AMD_i386_1
-   0   com.apple.cvmsCompAgent3425AMD_i386
281 0   com.apple.cfprefsd.xpc.agent
25191   0   com.hegenberg.BTTRelaunch.33184
2852    0   com.apple.iTunesHelper.19936
-   0   com.apple.unmountassistant.useragent
-   0   com.apple.java.InstallOnDemand
-   0   com.apple.DataDetectorsLocalSources
2872    0   com.apple.keyboardservicesd
2756    0   com.apple.quicklook.ThumbnailsAgent
-   0   com.apple.csuseragent
-   0   com.apple.CoreRAIDAgent
-   0   com.apple.AOSPushRelay
2822    0   com.apple.SocialPushAgent
-   0   com.apple.apsctl
-   0   com.apple.xpc.loginitemregisterd
-   0   com.apple.coreservices.UASharedPasteboardProgressUI
2920    0   com.apple.applespell
2811    0   com.apple.ctkd
2762    0   com.apple.AddressBook.ContactsAccountsService
-   0   com.apple.warmd_agent
-   0   com.apple.PubSub.Agent
-   0   com.apple.pictd
-   0   com.apple.universalaccesscontrol
-   0   com.apple.Safari.SafeBrowsing.Service
-   0   com.apple.findmymacmessenger
-   0   com.apple.FilesystemUI
-   0   com.apple.pluginkit.pkreporter
-   0   com.apple.systemprofiler
2928    0   com.apple.lateragent
-   0   com.apple.UserNotificationCenterAgent
2843    0   com.apple.noticeboard.agent
-   0   com.apple.dt.CommandLineTools.installondemand
2772    0   com.apple.cmfsyncagent
2784    0   com.apple.cloudd
-   0   com.apple.ATS.FontValidator
2847    0   com.apple.diagnostics_agent
-   0   com.apple.appleseed.seedusaged
-   0   com.apple.PhotoLibraryMigrationUtility.XPC
2974    0   com.apple.LocalAuthentication.UIAgent
-   0   com.openssh.ssh-agent
2778    0   com.apple.networkserviceproxy
1654    0   com.apple.tonelibraryd
-   0   com.apple.WeatherService
399 0   com.apple.CloudPhotosConfiguration
-   0   com.apple.spotlight.IndexAgent
-   0   com.apple.mdworker.bundles
-   0   com.apple.mdworker.single.05000000-0000-0000-0000-000000000000
-   0   com.apple.mdworker.lsb.02000000-0000-0000-0000-000000000000
1710    0   com.apple.sbd
-   0   com.apple.DownloadFolderImporter
316 0   com.apple.secinitd
-   0   com.apple.cvmsCompAgent3600_i386_1
-   0   com.apple.facebook.xpc
-   0   com.apple.cvmsCompAgentLegacy_i386
-   0   com.apple.ctkbind
2754    0   com.apple.cloudphotosd
-   0   com.apple.alf.useragent
2745    0   com.apple.tccd
-   0   com.google.keystone.system.agent
26141   0   com.apple.coreservices.uiagent
2830    0   com.apple.Siri.agent
-   0   com.apple.installd.user
-   0   com.apple.ContainerRepairAgent
2769    0   com.apple.akd
2801    0   com.apple.CallHistoryPluginHelper
-   0   com.apple.Preview.19684
-   0   com.apple.NetworkDiagnostics
-   0   com.apple.InstallerProgress
2803    0   com.apple.storeaccountd
-   0   com.apple.PCIESlotCheck
2973    0   com.apple.security.keychainsyncingoveridsproxy
-   0   com.apple.PIPAgent
-   0   com.apple.mbfloagent
-   0   com.apple.AddressBook.AssistantService
-   0   com.apple.quicklook.32bit
3951    0   com.apple.printtool.agent
-   0   com.apple.IMLoggingAgent
-   0   com.apple.USBAgent
2763    0   com.apple.nsurlstoraged
2840    0   com.apple.askpermissiond
25758   0   com.apple.webinspectord
-   0   com.apple.ssinvitationagent
-   0   com.apple.WebKit.PluginAgent
-   0   com.apple.speech.synthesisserver
-   0   com.apple.DiagnosticReportCleanup.plist
7405    0   com.apple.storeuid
-   0   com.apple.speech.speechdatainstallerd
3017    0   com.apple.rcd
-   0   com.apple.quicklook.config
2869    0   com.apple.printuitool.agent
-   0   com.apple.AOSHeartbeat
2845    0   com.bjango.istatmenusstatus
2809    0   com.apple.CryptoTokenKit.ahp.agent
-   0   com.apple.SafariNotificationAgent
-   0   com.apple.appsleep
2855    0   com.macpaw.CleanMyMac3.Menu.21392
-   0   com.apple.FileStatsAgent
2796    0   com.apple.coreservices.useractivityd
26576   0   com.apple.mdworker.single.03000000-0000-0000-0000-000000000000
-   0   com.apple.cvmsCompAgent3600_x86_64_1
-   0   com.apple.netauth.user.auth
2918    0   com.apple.ViewBridgeAuxiliary
-   0   com.apple.mbbackgrounduseragent
290 0   com.apple.lsd
-   0   com.apple.cvmsCompAgent_x86_64
-   0   com.apple.sharekit.EntitlementsHelper
-   0   com.apple.weibo.xpc
315 0   com.apple.pluginkit.pkd
-   0   com.apple.cvmsCompAgentLegacy_x86_64
-   0   com.apple.mdworker.mail.04000000-0000-0000-0000-000000000000
-   0   com.apple.security.XPCTimeStampingService
26575   0   com.apple.mdworker.single.08000000-0000-0000-0000-000000000000
-   0   com.apple.maspushagent
2819    0   com.apple.FolderActionsDispatcher
2749    0   com.apple.cache_delete
-   0   com.apple.personad
2875    0   com.apple.CallHistorySyncHelper
-   0   com.apple.accessibility.dfrhud
2802    0   com.apple.parsecd
2738    0   com.apple.Dock.agent
-   0   com.apple.iWork.Numbers.28408
2827    0   com.bjango.istatmenusnotifications
2724    0   com.apple.UserEventAgent-Aqua
-   0   com.apple.mbuseragent
-   0   com.apple.ReportPanic
2913    0   com.apple.followupd
2735    0   com.apple.telephonyutilities.callservicesd
2743    0   com.apple.identityservicesd
-   0   com.apple.DwellControl
-   0   com.apple.imavagent
4298    0   com.apple.security.DiskUnmountWatcher
-   0   com.apple.CoreLocationAgent
25748   0   com.apple.Safari.19696
-   0   com.apple.security.agent
-   0   com.apple.cfnetwork.AuthBrokerAgent
2755    0   com.apple.storedownloadd
2842    0   com.apple.cloudpaird
25186   0   com.apple.xpc.launchd.oneshot.0x100000f5.BetterTouchTool
2748    0   com.apple.pboard
2732    0   com.apple.coreservices.sharedfilelistd
2912    0   com.apple.reversetemplated
-   0   com.apple.nowplayingtouchui
-   0   com.apple.thermaltrap
2873    0   com.apple.SafariCloudHistoryPushAgent
-   0   com.apple.AskPermissionUI
26902   0   com.apple.mdworker.shared.02000000-0000-0000-0000-000000000000
-   0   com.apple.accounts.dom
409 0   com.apple.security.cloudkeychainproxy3
490 0   com.apple.metadata.mdflagwriter
691 0   com.apple.DictionaryServiceHelper
778 0   com.apple.speech.speechsynthesisd
-   0   com.apple.mdworker.shared
-   0   com.apple.mdworker.single.06000000-0000-0000-0000-000000000000
-   0   com.apple.mdworker.isolation
-   0   com.apple.messages.BuddyPictureService
-   0   com.apple.installandsetup.migrationhelper.user
310 0   com.apple.imdpersistence.IMDPersistenceAgent
-   0   com.apple.TrustEvaluationAgent
-   0   com.apple.tiswitcher
-   0   com.apple.eosauthagent
9175    0   com.apple.cdpd
2752    0   com.apple.accountsd
2824    0   2BUA8C4S2C.com.agilebits.onepassword-osx-helper
2927    0   com.apple.storelegacy
3162    0   com.apple.OSDUIHelper
26121   0   org.videolan.vlc.33368
-   0   com.apple.locationmenu
2932    0   com.apple.AssetCacheLocatorService
2793    0   com.apple.videosubscriptionsd
4368    0   com.apple.protectedcloudstorage.protectedcloudkeysyncing
2891    0   com.apple.pbs
2828    0   com.apple.notificationcenterui.agent
2829    0   com.apple.imklaunchagent
-   0   com.apple.imcore.imtransferagent
-   0   com.apple.FTCleanup
-   0   com.apple.btsa
-   0   com.apple.bluetooth.PacketLogger
2832    0   com.apple.icdd
2833    0   com.hp.devicemonitor
4094    0   com.apple.EscrowSecurityAlert
2837    0   com.apple.coreservices.appleid.authentication
3042    0   com.apple.metadata.mdwrite
-   0   com.apple.loginwindow.LWWeeklyMessageTracer
-   0   com.apple.screencapturetb.agent
2780    0   com.apple.CalendarAgent
-   0   com.apple.RapportUIAgent
2839    0   com.apple.powerchime
2896    0   com.binaryage.totalfinder.crashwatcher.17752
2798    0   com.apple.sharingd
2805    0   com.apple.storeassetd
-   0   com.apple.iCloudUserNotificationsd
-   0   com.apple.familycircled
-   0   com.oracle.java.Java-Updater
-   0   com.apple.ReportCrash.Self
2744    0   com.apple.imagent
-   0   com.apple.FontRegistryUIAgent
-   0   com.apple.syncservices.SyncServer
3310    0   com.apple.photoanalysisd
-   0   com.apple.ZoomWindow
-   0   com.apple.talagent
2741    0   com.apple.SystemUIServer.agent
2911    0   com.apple.suggestd
2903    0   com.apple.storeinappd
-   0   com.apple.imautomatichistorydeletionagent
-   0   com.apple.ATS.FontValidatorConduit
-   0   com.apple.navd
-   0   com.apple.VoiceOver
-   0   com.apple.RemoteDesktop.agent
-   0   com.apple.cloudfamilyrestrictionsd
2878    0   com.apple.icloud.fmfd
-   0   com.apple.AssistiveControl
-   0   com.apple.CoreSimulator.CoreSimulatorService
-   0   com.apple.mdworker.32bit.01000000-0000-0000-0000-000000000000
-   0   com.apple.mdworker.shared.00000000-0000-0000-0000-000000000000
-   0   com.apple.mdworker.32bit
293 0   com.apple.secd
786 0   com.apple.appstore.PluginXPCService
708 0   com.apple.hiservices-xpcservice
7153    0   com.apple.BKAgentService
-   0   com.apple.cvmsCompAgent_x86_64_1
-   0   com.apple.tencentweibo.xpc
-   0   com.apple.cvmsCompAgent_i386_1
-   0   com.apple.FCiCloudPrefUpdater
-   0   com.apple.cvmsCompAgentLegacy_i386_1
-   0   com.apple.cvmsCompAgent3600_i386
-   0   com.apple.mdworker.lsb
-   0   com.macpaw.CleanMyMac3.Scheduler
2818    0   com.apple.assistantd
-   0   com.apple.FollowUpUI
5656    0   com.apple.videoconference.camera
2729    0   com.apple.controlstrip
-   0   com.apple.mediaanalysisd
-   0   com.apple.isst
15901   0   com.apple.DiskArbitrationAgent
2816    0   com.apple.scopedbookmarksagent.xpc
-   0   com.apple.ReportCrash
2733    0   com.apple.fontd
2870    0   com.apple.Maps.mapspushd
-   0   com.apple.TextEdit.19716
-   0   com.apple.STMUIHelper
2876    0   com.apple.gamed
-   0   com.apple.java.updateSharing
-   0   com.apple.eospreflightagent
-   0   com.apple.midiserver
-   0   com.apple.quicklook.ui.helper
-   0   com.apple.helpd
2846    0   com.apple.wifi.WiFiAgent
-   0   com.apple.screensharing.MessagesAgent
4266    0   com.apple.diskspaced
2848    0   com.apple.passd
-   0   com.apple.FirmwareUpdateHelper
-   0   com.apple.DictationIM
2810    0   com.apple.CoreAuthentication.agent
-   0   com.apple.mdmclient.agent
26577   0   com.apple.iCloudHelper
-   0   com.apple.mdworker.single.07000000-0000-0000-0000-000000000000
395 0   com.apple.CharacterPicker.FileService
-   0   com.apple.mdworker.single.01000000-0000-0000-0000-000000000000
-   0   com.apple.iBooksX.CacheDelete
-   0   com.apple.storeinstallagent
-   0   com.apple.cvmsCompAgent3425AMD_x86_64
-   0   com.apple.linkedin.xpc
-   0   com.apple.security.XPCKeychainSandboxCheck
-   0   com.apple.mdworker.single
26695   0   com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000
-   0   com.apple.twitter.xpc
-   0   com.apple.cvmsCompAgentLegacy_x86_64_1
-   0   com.apple.scrod
2820    0   com.apple.spindump_agent
2925    0   com.apple.softwareupdate_notify_agent
-   0   com.apple.security.keychain-circle-notification
-   0   com.apple.icloud.findmydeviced.findmydevice-user-agent
2854    0   com.elgato.eyetvhelper.4312
-   0   com.apple.universalaccessd
-   0   com.apple.AirPortBaseStationAgent
25745   0   net.sourceforge.nzbget.33228
-   0   com.apple.appstoreupdateagent
2901    0   com.apple.recentsd
-   0   com.apple.neagent
-   0   com.apple.idsfoundation.IDSRemoteURLConnectionAgent
2933    0   com.apple.WiFiVelocityAgent
2773    0   com.apple.usernoted
2856    0   com.binaryage.totalfinder.agent.19724
-   0   com.apple.SafariPlugInUpdateNotifier
2753    0   com.apple.geodMachServiceBridge
25671   0   com.google.Chrome.28764
-   0   com.apple.AddressBook.abd
-   0   com.apple.ScreenReaderUIServer
2794    0   com.apple.swcd
2841    0   com.apple.AirPlayUIAgent
-   0   com.apple.safaridavclient
2727    0   com.apple.touchbar.agent
-   0   com.apple.netauth.user.gui
-   0   com.apple.TMHelperAgent
2886    0   com.apple.Spotlight
2800    0   com.apple.soagent
-   0   com.apple.mdworker.32bit.02000000-0000-0000-0000-000000000000
723 0   com.apple.accessibility.mediaaccessibilityd
26922   0   com.apple.syncdefaultsd
-   0   com.apple.cvmsCompAgent3425AMD_x86_64_1
535 0   com.apple.mdworker.sizing
-   0   com.apple.SpeechRecognitionCore.brokerd
-   0   com.apple.metadata.mdbulkimport
26921   0   com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000
-   0   com.apple.iokit.IOServiceAuthorizeAgent
-   0   com.apple.cvmsCompAgent3600_x86_64
-   0   com.apple.mdworker.single.04000000-0000-0000-0000-000000000000
286 0   com.apple.distnoted.xpc.agent
-   0   com.apple.cvmsCompAgent_i386
-   0   com.apple.mdworker.lsb.01000000-0000-0000-0000-000000000000
365 0   com.apple.geod
Francoiss-MacBook-Pro:~ Francois$ 

When I do a telnet localhost 4222 VLC is doing its job so runing the .plist is the only step that blocks me.

Francoiss-MacBook-Pro:~ Francois$ telnet localhost 4222
Trying ::1...
Connected to localhost.
Escape character is '^]'.
VLC media player 2.2.6 Umbrella
Command Line Interface initialized. Type `help' for help.
thebluepotato commented 7 years ago

Hi! I've just found out that the reason I had no scrobbles for some time was because TraktForVLC wasn't launched by launchd anymore. Try running: python /Users/Francois/TraktForVLC/TraktForVLC.py directly and see what you get. My issue was that fuzzywuzzy, imdbpie and python-levenshtein weren't installed (and are now required I guess). So I installed them, checked it could be run from Terminal and then launchctl load ~/Library/LaunchAgents/org.TraktForVLC.plist again and voilà, it was back in the list !

Francis2b commented 7 years ago

Here what I get when I type python /Users/Francois/TraktForVLC/TraktForVLC.py

Francoiss-MacBook-Pro:~ Francois$ python /Users/Francois/TraktForVLC/TraktForVLC.py
Traceback (most recent call last):
  File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 36, in <module>
    import requests
ImportError: No module named requests
Francoiss-MacBook-Pro:~ Francois$ 
XaF commented 7 years ago

Please install all the dependencies indicated in the requirements.txt file. With the last update, part of the requirements were removed from the TraktForVLC repository in the idea that it should be managed and installed on the client side directly!

Francis2b commented 7 years ago

Ok thanks for the info XaF! So I took the latest version with the requirements included to make it easier for me. Now I have this:

Francoiss-MacBook-Pro:~ Francois$ python /Users/Francois/TraktForVLC/TraktForVLC.py /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fuzzywuzzy/fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') Traceback (most recent call last): File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 54, in <module> import movie_info File "/Users/Francois/TraktForVLC/movie_info.py", line 33, in <module> import imdbpie File "/Users/Francois/TraktForVLC/imdbpie/__init__.py", line 1, in <module> from .imdbpie import Imdb File "/Users/Francois/TraktForVLC/imdbpie/imdbpie.py", line 12, in <module> from cachecontrol import CacheControl ImportError: No module named cachecontrol Francoiss-MacBook-Pro:~ Francois$

thebluepotato commented 7 years ago

Try the commands mentioned here : https://github.com/XaF/TraktForVLC/issues/67#issuecomment-310813055 pip install fuzzywuzzy or sudo pip install fuzzywuzzy should do the trick. Same goes for the other modules/requirements mentioned in my previous comment. EDIT : I changes easy_install to install (no idea why I wrote that in the first place...)

Francis2b commented 7 years ago

It's fine a finaly figure out how to run org.user.TraktForVLC ! But it doesn't seem to keep track of what I'm watching :/

edit:

2017-07-15 22:57:23,727::TraktForVLC::ERROR::An error occurred while trying to mark as watching South Park - 2x04 Traceback (most recent call last): File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 559, in main self.get_episode(video)) File "/Users/Francois/TraktForVLC/TraktClient.py", line 420, in startWatching return self.__watching('start', imdb_id, progress, episode) File "/Users/Francois/TraktForVLC/TraktClient.py", line 377, in __watching progress=progress) File "/Users/Francois/TraktForVLC/TraktClient.py", line 416, in __watchingEpisode return self.__scrobble(action, data) File "/Users/Francois/TraktForVLC/TraktClient.py", line 347, in __scrobble self.__get_access_token() File "/Users/Francois/TraktForVLC/TraktClient.py", line 295, in __get_access_token stream.status_code, stream.reason)) TraktError: Unable to authenticate: 401 Unauthorized

thebluepotato commented 7 years ago

I just found out mine had the same issue. I'm guessing the recent VLC update reset that part of the settings? Just follow the TrakForVLC guide again : https://github.com/XaF/TraktForVLC#configuring-vlc EDIT: I see you've edited and mine wasn't finding VLC on localhost:4222, so not the same issue. Maybe you should close this one and open a new one/check if this is an issue others have too.

Francis2b commented 7 years ago

I followed the guide and now I get this:

Francoiss-MacBook-Pro:~ Francois$ python /Users/Francois/TraktForVLC/TraktForVLC.py Traceback (most recent call last): File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 875, in <module> daemon=(should_daemon or pidfile)) File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 225, in __init__ self.__check_version() File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 100, in __check_version url="https://api.github.com/repos/XaF/TraktForVLC/releases") File "/Users/Francois/TraktForVLC/requests/api.py", line 68, in get return request('get', url, **kwargs) File "/Users/Francois/TraktForVLC/requests/api.py", line 50, in request response = session.request(method=method, url=url, **kwargs) File "/Users/Francois/TraktForVLC/requests/sessions.py", line 464, in request resp = self.send(prep, **send_kwargs) File "/Users/Francois/TraktForVLC/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/Users/Francois/TraktForVLC/requests/adapters.py", line 415, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))

In the ini file the pin code didn't change into token strange :/

edit: I'm using TraktForVLC-1.3.0-rc2