XaF / TraktForVLC

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

File's titles #59

Closed Dimsok closed 7 years ago

Dimsok commented 7 years ago

I always add to name's movies (languages of sounds) (languages of subs). For example "Terminator (ru+en) (spa+it).mkv". And with UseFilenames = No in config ini i can't make it scrobble. I've read that with that settings the title of movie gets from vlc window, but even when in that window there is only "Terminator" without any parenthesis, i can't get it scrobbled. Is there any solution?

Dimsok commented 7 years ago

Hm, i found out why. It cause i gave them the titles in mkvtoolnix. The mkvs which i cant scrobble doesn't have tags and in vlc windows have .mkv ext at the end. But if i tag them they can't scrobble. And what should i do, tag as title.mkv? The option "use filnemes=yes" doesn't work at all. Maybe is there a way to change a way how vlc player shows window's title?

XaF commented 7 years ago

I'll try to work asap on a fix for #66, I'll ask for confirmation for this bug after this.

Dimsok commented 7 years ago

Don't understand, what gives option "UseFilenames = Yes". Means, that if file's name, for example, "Terminator.avi", it should scrobble directly without imdb, opensubs etc? I did try to rename, but doesn't seem working.

XaF commented 7 years ago

Using VLC remote control, we have access to two distinct information: (1) - The file path (C:\path\to\my movie.mkv), and thus its file name (my movie.mkv) (2) - The name as determined by VLC (My Movie if we have My Movie as title tag, or if the title tag is empty, it's usually the file path/name

With the option UseFilenames = Yes, we ignore the name determined by VLC (2) and only consider the file name (1) to determine which movie/series you are looking at. We still use parsing after that to get the actual full information on what you are looking at, but our starting point is different in both cases.

If for instance you have a movie "My Super Movie.avi" that is tagged with "Another Movie Title" as title, if you use the option (2) (UseFilenames = No) you will search for a movie matching "Another Movie Title", but if you use option (1) (UseFilenames = Yes) you will search for a movie matching "My Super Movie". If you're used to watching movies that are wrongfully tagged, but that have right file names, you may want to set that option to Yes.

Dimsok commented 7 years ago

Is it possible to take names from tags, like last.fm, without net services? Mkv, mp4 and avi support it.

XaF commented 7 years ago

The name is not sufficient. Scrobbling needs an ID, and the most generic ID is the IMDB ID. That's the main reason for using net services.

Dimsok commented 7 years ago

Anyway tagged movies doesn't scrobble for me:

2017-06-24 16:12:31,101::TraktForVLC::INFO::## TraktForVLC v1.3.0-rc3 Breaking Bad
2017-06-24 16:12:31,101::TraktForVLC::INFO::## Copyright (C) 2014-2015  Raphael Beamonte <raphael.beamonte@gmail.com>
2017-06-24 16:12:31,101::TraktForVLC::INFO::##
2017-06-24 16:12:31,101::TraktForVLC::INFO::## TraktForVLC is distributed in the hope that it will be useful, but
2017-06-24 16:12:31,101::TraktForVLC::INFO::## with ABSOLUTELY NO WARRANTY. This is free software; you are welcome
2017-06-24 16:12:31,101::TraktForVLC::INFO::## to redistribute and/or modify it under the terms of the GPL2.
2017-06-24 16:12:31,101::TraktForVLC::INFO::
2017-06-24 16:12:31,148::TraktForVLC::DEBUG::Running on Windows-XP-5.1.2600-SP3, with Python 2.7.2
2017-06-24 16:12:31,351::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api.github.com
2017-06-24 16:12:40,805::requests.packages.urllib3.connectionpool::DEBUG::"GET /repos/XaF/TraktForVLC/releases HTTP/1.1" 200 None
2017-06-24 16:12:40,914::TraktForVLC::INFO::VERSION:TraktForVLC is up to date
2017-06-24 16:12:40,914::TraktForVLC::INFO::Logger level is set to DEBUG
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Will scrobble movies ? Yes
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Will scrobble tv shows ? Yes
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Will we mark movies as being watched ? Yes
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Will we mark tv shows as being watched ? Yes
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Videos will be scrobbled after 90% of their duration has been exceeded
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Timer set to 5 secs
2017-06-24 16:12:40,914::TraktForVLC::INFO::-- Video will be marked as "is watching" from 5 secs
2017-06-24 16:12:40,914::TraktForVLC::INFO::Listening VLC to localhost:4222
2017-06-24 16:12:40,946::TraktClient::DEBUG::TraktClient logger initialized
2017-06-24 16:12:40,946::TraktClient::DEBUG::TraktClient will use PIN Auth
2017-06-24 16:12:40,946::TraktForVLC::DEBUG::reset cache (None, None)
2017-06-24 16:12:41,493::VLCRemote::DEBUG::-> Sending: is_playing
2017-06-24 16:12:41,493::VLCRemote::DEBUG::<- Received: 1
2017-06-24 16:12:41,493::VLCRemote::DEBUG::-> Sending: get_length
2017-06-24 16:12:41,493::VLCRemote::DEBUG::<- Received: 7401
2017-06-24 16:12:41,493::VLCRemote::DEBUG::-> Sending: status
2017-06-24 16:12:41,493::VLCRemote::DEBUG::<- Received: status change: ( new input: file:///g:/%D0%92%D0%B8%D0%B4%D0%B5%D0%BE/%D0%A4%D0%B8%D0%BB%D1%8C%D0%BC%D1%8B/%D0%9D%D0%B0%20%D0%90%D0%BD%D0%B3%D0%BB%D0%B8%D0%B9%D1%81%D0%BA%D0%BE%D0%BC/MKV/%D0%91%D0%BE%D0%B5%D0%B2%D0%B8%D0%BA%D0%B8/Die%20Hard%202%20%28Eng%29%20%28Ru%2BEng%2BFr%2BGer%2BPor%2BSpa%29.mkv )
2017-06-24 16:12:41,507::VLCRemote::DEBUG::cleaning cache
2017-06-24 16:12:41,507::VLCRemote::DEBUG::<- Received: status change: ( audio volume: 512 )

status change: ( play state: 3 )

status: returned 0 (no error)
2017-06-24 16:12:41,507::VLCRemote::DEBUG::-> Sending: get_title
2017-06-24 16:12:41,507::VLCRemote::DEBUG::<- Received: Die Hard 2
2017-06-24 16:12:41,507::VLCRemote::DEBUG::-> Sending: get_time
2017-06-24 16:12:41,507::VLCRemote::DEBUG::<- Received: 40
2017-06-24 16:12:41,507::TraktForVLC::DEBUG::main::New file: Die Hard 2 (7401)
2017-06-24 16:12:41,507::TraktForVLC::DEBUG::reset cache (Die Hard 2, 7401)
2017-06-24 16:12:41,507::TraktForVLC::INFO::Not able to parse a tvshow from the file title
2017-06-24 16:12:41,507::TraktForVLC::INFO::No matching movie found for video playing
2017-06-24 16:12:41,507::TraktForVLC::DEBUG::get_Movie::Here's to help debug
Traceback (most recent call last):
  File "c:\PROGRA~1\VideoLAN\VLC\TraktForVLC\TraktForVLC.py", line 656, in get_Movie
    title = now_playing['title']
TypeError: 'bool' object is not subscriptable
2017-06-24 16:12:41,539::TraktForVLC::INFO::No tv show nor movie found for the current playing video
2017-06-24 16:12:46,930::VLCRemote::DEBUG::-> Sending: is_playing
2017-06-24 16:12:46,930::VLCRemote::DEBUG::<- Received: 1
2017-06-24 16:12:46,930::VLCRemote::DEBUG::-> Sending: get_length
2017-06-24 16:12:46,946::VLCRemote::DEBUG::<- Received: 7401
2017-06-24 16:12:46,946::VLCRemote::DEBUG::-> Sending: status
2017-06-24 16:12:46,946::VLCRemote::DEBUG::<- Received: status change: ( new input: file:///g:/%D0%92%D0%B8%D0%B4%D0%B5%D0%BE/%D0%A4%D0%B8%D0%BB%D1%8C%D0%BC%D1%8B/%D0%9D%D0%B0%20%D0%90%D0%BD%D0%B3%D0%BB%D0%B8%D0%B9%D1%81%D0%BA%D0%BE%D0%BC/MKV/%D0%91%D0%BE%D0%B5%D0%B2%D0%B8%D0%BA%D0%B8/Die%20Hard%202%20%28Eng%29%20%28Ru%2BEng%2BFr%2BGer%2BPor%2BSpa%29.mkv )
2017-06-24 16:12:46,946::VLCRemote::DEBUG::cleaning cache
2017-06-24 16:12:46,946::VLCRemote::DEBUG::<- Received: status change: ( audio volume: 512 )

status change: ( play state: 3 )

status: returned 0 (no error)
2017-06-24 16:12:46,946::VLCRemote::DEBUG::-> Sending: get_title
2017-06-24 16:12:46,946::VLCRemote::DEBUG::<- Received: Die Hard 2
2017-06-24 16:12:46,946::VLCRemote::DEBUG::-> Sending: get_time
2017-06-24 16:12:46,946::VLCRemote::DEBUG::<- Received: 45
2017-06-24 16:12:46,946::TraktForVLC::INFO::No tv show nor movie found for the current playing video
XaF commented 7 years ago

Ok, I see the problem here. However, out of curiosity, if you did not move the file since then, could you please execute the following:

import os
from urllib import unquote
fname = "file:///g:/%D0%92%D0%B8%D0%B4%D0%B5%D0%BE/%D0%A4%D0%B8%D0%BB%D1%8C%D0%BC%D1%8B/%D0%9D%D0%B0%20%D0%90%D0%BD%D0%B3%D0%BB%D0%B8%D0%B9%D1%81%D0%BA%D0%BE%D0%BC/MKV/%D0%91%D0%BE%D0%B5%D0%B2%D0%B8%D0%BA%D0%B8/Die%20Hard%202%20%28Eng%29%20%28Ru%2BEng%2BFr%2BGer%2BPor%2BSpa%29.mkv"
print os.path.isfile(fname)
print os.path.isfile(unquote(fname))

And paste me the result ? That will help me insure that I'm fixing that correctly.