Skip to content

Commit

Permalink
faq, host ads, duplicate track, format unsupported (#51)
Browse files Browse the repository at this point in the history
close #50 - duplicate vs overwrite recorded tracks
info #49 - catching the exception - format not supported
close #37 - ads can be disabled
updated faq
  • Loading branch information
jwallet authored Sep 19, 2018
1 parent 36aeab7 commit 87ca49d
Show file tree
Hide file tree
Showing 11 changed files with 586 additions and 233 deletions.
9 changes: 6 additions & 3 deletions EspionSpotify/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
<setting name="DisableAds" serializeAs="String">
<value>False</value>
</setting>
<setting name="AdHosts" serializeAs="String">
<value>adclick.g.doublecklick.net;adeventtracker.spotify.com;ads.pubmatic.com;ads-fa.spotify.com;analytics.spotify.com;audio-sp-dca.spotify.com;audio2.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;gads.pubmatic.com;googleads.g.doubleclick.net;googleadservices.com;gtssl2-ocsp.geotrust.com;heads4-ak.spotify.com.edgesuite.net;js.moatads.com;log.spotify.com;media-match.com;omaze.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;redirector.gvt1.com;s0.2mdn.net;securepubads.g.doubleclick.net;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;weblb-wg.gslb.spotify.comcker.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com</value>
</setting>
<setting name="EndingSongDelayEnabled" serializeAs="String">
<value>True</value>
</setting>
Expand All @@ -58,6 +55,12 @@
<setting name="AnalyticsCID" serializeAs="String">
<value />
</setting>
<setting name="AdHosts" serializeAs="String">
<value>adeventtracker.spotify.com;ads.pubmatic.com;ads-fa.spotify.com;analytics.spotify.com;audio-sp-dca.spotify.com;audio2.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;gads.pubmatic.com;googleads.g.doubleclick.net;googleadservices.com;gtssl2-ocsp.geotrust.com;heads4-ak.spotify.com.edgesuite.net;js.moatads.com;log.spotify.com;media-match.com;omaze.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;redirector.gvt1.com;s0.2mdn.net;securepubads.g.doubleclick.net;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;weblb-wg.gslb.spotify.comcker.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com;adclick.g.doublecklick.net;adeventtracker.spotify.com;adnxs.com;ads.yahoo.com;ads-fa.spotify.com;agkn.com;analytics.spotify.com;audio2.spotify.com;audio-ec.spotify.com;audio-fa.spotify.com;audio-sp.spotify.com;audio-sp-ash.spotify.com;audio-sp-tyo.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;cloudfront.net;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;fastclick.net;googleads.g.doubleclick.net;googleadservices.com;googlesyndication.com;googletagservices.com;gtssl2-ocsp.geotrust.com;gvt1.com;heads-fab.spotify.com;js.moatads.com;log.spotify.com;media-match.com;omaze.com;open.spotify.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;pubmatic.com;ravenjs.com;redirector.gvt1.com;rlcdn.com;s0.2mdn.net;securepubads.g.doubleclick.net;spclient.wg.spotify.com;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com</value>
</setting>
<setting name="DuplicateAlreadyRecordedTrack" serializeAs="String">
<value>True</value>
</setting>
</EspionSpotify.Properties.Settings>
</userSettings>
<runtime>
Expand Down
1 change: 1 addition & 0 deletions EspionSpotify/Models/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class UserSettings
public bool RecordUnknownTrackTypeEnabled { get; set; }
public ISpotifyAudioSession SpotifyAudioSession { get; set; }
public int? InternalOrderNumber { get; set; }
public bool DuplicateAlreadyRecordedTrack { get; set; }

public int? OrderNumber {
get => OrderNumberInfrontOfFileEnabled || OrderNumberInMediaTagEnabled ? InternalOrderNumber : null;
Expand Down
62 changes: 50 additions & 12 deletions EspionSpotify/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions EspionSpotify/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
<Setting Name="DisableAds" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AdHosts" Type="System.String" Scope="User">
<Value Profile="(Default)">adclick.g.doublecklick.net;adeventtracker.spotify.com;ads.pubmatic.com;ads-fa.spotify.com;analytics.spotify.com;audio-sp-dca.spotify.com;audio2.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;gads.pubmatic.com;googleads.g.doubleclick.net;googleadservices.com;gtssl2-ocsp.geotrust.com;heads4-ak.spotify.com.edgesuite.net;js.moatads.com;log.spotify.com;media-match.com;omaze.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;redirector.gvt1.com;s0.2mdn.net;securepubads.g.doubleclick.net;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;weblb-wg.gslb.spotify.comcker.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com</Value>
</Setting>
<Setting Name="EndingSongDelayEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
Expand All @@ -50,5 +47,11 @@
<Setting Name="AnalyticsCID" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AdHosts" Type="System.String" Scope="User">
<Value Profile="(Default)">adeventtracker.spotify.com;ads.pubmatic.com;ads-fa.spotify.com;analytics.spotify.com;audio-sp-dca.spotify.com;audio2.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;gads.pubmatic.com;googleads.g.doubleclick.net;googleadservices.com;gtssl2-ocsp.geotrust.com;heads4-ak.spotify.com.edgesuite.net;js.moatads.com;log.spotify.com;media-match.com;omaze.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;redirector.gvt1.com;s0.2mdn.net;securepubads.g.doubleclick.net;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;weblb-wg.gslb.spotify.comcker.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com;adclick.g.doublecklick.net;adeventtracker.spotify.com;adnxs.com;ads.yahoo.com;ads-fa.spotify.com;agkn.com;analytics.spotify.com;audio2.spotify.com;audio-ec.spotify.com;audio-fa.spotify.com;audio-sp.spotify.com;audio-sp-ash.spotify.com;audio-sp-tyo.spotify.com;b.scorecardresearch.com;bounceexchange.com;bs.serving-sys.com;cloudfront.net;content.bitsontherun.com;core.insightexpressai.com;crashdump.spotify.com;d2gi7ultltnc2u.cloudfront.net;d3rt1990lpmkn.cloudfront.net;desktop.spotify.com;doubleclick.net;ds.serving-sys.com;fastclick.net;googleads.g.doubleclick.net;googleadservices.com;googlesyndication.com;googletagservices.com;gtssl2-ocsp.geotrust.com;gvt1.com;heads-fab.spotify.com;js.moatads.com;log.spotify.com;media-match.com;omaze.com;open.spotify.com;pagead2.googlesyndication.com;pagead46.l.doubleclick.net;partner.googleadservices.com;pubads.g.doubleclick.net;pubmatic.com;ravenjs.com;redirector.gvt1.com;rlcdn.com;s0.2mdn.net;securepubads.g.doubleclick.net;spclient.wg.spotify.com;tpc.googlesyndication.com;v.jwpcdn.com;video-ad-stats.googlesyndication.com;weblb-wg.gslb.spotify.com;www.googleadservices.com;www.googletagservices.com;www.omaze.com</Value>
</Setting>
<Setting Name="DuplicateAlreadyRecordedTrack" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
26 changes: 18 additions & 8 deletions EspionSpotify/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ public void Run()

if (_writer == null)
{
if (!Directory.Exists(_userSettings.OutputPath))
{
_form.WriteIntoConsole(FrmEspionSpotify.Rm.GetString($"logInvalidOutput"));
return;
}
_form.WriteIntoConsole(FrmEspionSpotify.Rm.GetString($"logWriterIsNull"));
return;
}

Expand Down Expand Up @@ -131,8 +125,24 @@ private Stream GetFileWriter(WasapiLoopbackCapture waveIn)

return writer;
}
catch (Exception ex)
catch (Exception ex)
{
var message = $"{FrmEspionSpotify.Rm.GetString($"logUnknownException")}: ${ex.Message}";

if (!Directory.Exists(_userSettings.OutputPath))
{
message = FrmEspionSpotify.Rm.GetString($"logInvalidOutput");
}
else if (ex.Message.StartsWith("Unsupported Sample Rate"))
{
message = FrmEspionSpotify.Rm.GetString($"logWriterIsNull");
}
else if (ex.Message.StartsWith("Access to the path"))
{
message = FrmEspionSpotify.Rm.GetString($"logNoAccessOutput");
}

_form.WriteIntoConsole(message);
Console.WriteLine(ex.Message);
return null;
}
Expand Down Expand Up @@ -181,7 +191,7 @@ private string BuildFileName(string path, bool includePath = true)
var filename = GetFileName(songNameTrackNumber, FirstSongNameCount, includePath ? path : null);
var count = FirstSongNameCount;

while (File.Exists(GetFileName(songNameTrackNumber, count, path)))
while (_userSettings.DuplicateAlreadyRecordedTrack && File.Exists(GetFileName(songNameTrackNumber, count, path)))
{
if (includePath) count++;
filename = GetFileName(songNameTrackNumber, count, includePath ? path : null);
Expand Down
Loading

0 comments on commit 87ca49d

Please sign in to comment.