mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-16 09:05:16 +00:00
Compare commits
6 Commits
9c502c013d
...
fc9e9f8f4c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fc9e9f8f4c | ||
![]() |
b248f90403 | ||
![]() |
e2c0ddef24 | ||
![]() |
ff252d6b14 | ||
![]() |
195cad8f39 | ||
![]() |
19f525fa3c |
@ -137,16 +137,16 @@
|
|||||||
"pre_download_play_description": "Anzi che effettuare lo stream dell'audio, scarica invece i byte e li riproduce (raccomandato per gli utenti con banda più alta)",
|
"pre_download_play_description": "Anzi che effettuare lo stream dell'audio, scarica invece i byte e li riproduce (raccomandato per gli utenti con banda più alta)",
|
||||||
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
|
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
|
||||||
"blacklist_description": "Tracce e artisti in blacklist",
|
"blacklist_description": "Tracce e artisti in blacklist",
|
||||||
"wait_for_download_to_finish": "Prego attendere che lo scaricamento corrente finisca",
|
"wait_for_download_to_finish": "Prego attendere che il download corrente finisca",
|
||||||
"desktop": "Desktop",
|
"desktop": "Desktop",
|
||||||
"close_behavior": "Comportamento Chiusura",
|
"close_behavior": "Comportamento Chiusura",
|
||||||
"close": "Chiudi",
|
"close": "Chiudi",
|
||||||
"minimize_to_tray": "Minimizza in tray",
|
"minimize_to_tray": "Minimizza in tray",
|
||||||
"show_tray_icon": "Mostra icona in tray di sistema",
|
"show_tray_icon": "Mostra icona in tray di sistema",
|
||||||
"about": "A proposito di",
|
"about": "Informazioni su",
|
||||||
"u_love_spotube": "Sappiamo che ami Spotube",
|
"u_love_spotube": "Sappiamo che ami Spotube",
|
||||||
"check_for_updates": "Controlla aggiornamenti",
|
"check_for_updates": "Controlla aggiornamenti",
|
||||||
"about_spotube": "A proposito di Spotube",
|
"about_spotube": "Informazioni su Spotube",
|
||||||
"blacklist": "Blacklist",
|
"blacklist": "Blacklist",
|
||||||
"please_sponsor": "Per favore sponsorizza/dona",
|
"please_sponsor": "Per favore sponsorizza/dona",
|
||||||
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
||||||
@ -187,7 +187,7 @@
|
|||||||
"generate_playlist": "Genera Playlist",
|
"generate_playlist": "Genera Playlist",
|
||||||
"track_exists": "La traccia {track} esiste già",
|
"track_exists": "La traccia {track} esiste già",
|
||||||
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
|
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
|
||||||
"skip_download_tracks": "Salta lo scaricamento di tutte le tracce scaricate",
|
"skip_download_tracks": "Salta il download di tutte le tracce scaricate",
|
||||||
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
|
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
|
||||||
"replace": "Sovrascrivi",
|
"replace": "Sovrascrivi",
|
||||||
"skip": "Salta",
|
"skip": "Salta",
|
||||||
@ -256,7 +256,7 @@
|
|||||||
"querying_info": "Richiesta informazioni...",
|
"querying_info": "Richiesta informazioni...",
|
||||||
"piped_api_down": "Le Piped API non funzionano",
|
"piped_api_down": "Le Piped API non funzionano",
|
||||||
"piped_down_error_instructions": "L'istanza di Piped {pipedInstance} è correntemente offline\n\nCambia istanza o cambia 'Tipo API' alle API ufficiali YouTube\n\nAssicurati di riavviare l'app dopo il cambio",
|
"piped_down_error_instructions": "L'istanza di Piped {pipedInstance} è correntemente offline\n\nCambia istanza o cambia 'Tipo API' alle API ufficiali YouTube\n\nAssicurati di riavviare l'app dopo il cambio",
|
||||||
"you_are_offline": "Sei correntemente offline",
|
"you_are_offline": "Al momento sei offline",
|
||||||
"connection_restored": "Connessione ad internet ripristinata",
|
"connection_restored": "Connessione ad internet ripristinata",
|
||||||
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
||||||
"crunching_results": "Elaborazione risultati...",
|
"crunching_results": "Elaborazione risultati...",
|
||||||
@ -267,15 +267,15 @@
|
|||||||
"change_cover": "Cambia copertina",
|
"change_cover": "Cambia copertina",
|
||||||
"add_cover": "Aggiungi copertina",
|
"add_cover": "Aggiungi copertina",
|
||||||
"restore_defaults": "Ripristina default",
|
"restore_defaults": "Ripristina default",
|
||||||
"download_music_codec": "Codec musicale scaricamento",
|
"download_music_codec": "Codec download musica",
|
||||||
"streaming_music_codec": "Codec musicale streaming",
|
"streaming_music_codec": "Codec streaming musica",
|
||||||
"login_with_lastfm": "Accesso a Last.fm",
|
"login_with_lastfm": "Accedi con Last.fm",
|
||||||
"connect": "Connetti",
|
"connect": "Connettiti",
|
||||||
"disconnect_lastfm": "Disconnetti Last.fm",
|
"disconnect_lastfm": "Disconnettiti da Last.fm",
|
||||||
"disconnect": "Disconnetti",
|
"disconnect": "Disconnetti",
|
||||||
"username": "Nome utente",
|
"username": "Nome utente",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"login": "Accesso",
|
"login": "Accedi",
|
||||||
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
||||||
"scrobble_to_lastfm": "Invia a Last.fm",
|
"scrobble_to_lastfm": "Invia a Last.fm",
|
||||||
"audio_source": "Fonte audio",
|
"audio_source": "Fonte audio",
|
||||||
@ -299,7 +299,7 @@
|
|||||||
"song_link": "Link della Canzone",
|
"song_link": "Link della Canzone",
|
||||||
"skip_this_nonsense": "Salta questa sciocchezza",
|
"skip_this_nonsense": "Salta questa sciocchezza",
|
||||||
"freedom_of_music": "“Libertà della Musica”",
|
"freedom_of_music": "“Libertà della Musica”",
|
||||||
"freedom_of_music_palm": "“Libertà della Musica nel palmo della tua mano”",
|
"freedom_of_music_palm": "“Libertà della Musica nelle tue mani”",
|
||||||
"get_started": "Cominciamo",
|
"get_started": "Cominciamo",
|
||||||
"youtube_source_description": "Consigliato e funziona meglio.",
|
"youtube_source_description": "Consigliato e funziona meglio.",
|
||||||
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
||||||
|
@ -215,16 +215,12 @@ class ServerPlaybackRoutes {
|
|||||||
? activeSourcedTrack?.source
|
? activeSourcedTrack?.source
|
||||||
: await ref.read(
|
: await ref.read(
|
||||||
trackSourcesProvider(
|
trackSourcesProvider(
|
||||||
TrackSourceQuery.parseUri(request.url.toString()),
|
//! Use [Request.requestedUri] as it contains full https url.
|
||||||
|
//! [Request.url] will exclude and starts relatively. (streams/<trackId>... basically)
|
||||||
|
TrackSourceQuery.parseUri(request.requestedUri.toString()),
|
||||||
).future,
|
).future,
|
||||||
);
|
);
|
||||||
|
|
||||||
// This will be automatically updated by the notifier.
|
|
||||||
// if (playlist.activeTrack?.id == sourcedTrack?.query.id &&
|
|
||||||
// sourcedTrack != null) {
|
|
||||||
// ref.read(activeTrackSourcesProvider.notifier).update(sourcedTrack);
|
|
||||||
// }
|
|
||||||
|
|
||||||
final (bytes: audioBytes, response: res) =
|
final (bytes: audioBytes, response: res) =
|
||||||
await streamTrack(sourcedTrack!, request.headers);
|
await streamTrack(sourcedTrack!, request.headers);
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ abstract class SourcedTrack extends BasicSourcedTrack {
|
|||||||
onlyCleanArtist: true,
|
onlyCleanArtist: true,
|
||||||
).trim();
|
).trim();
|
||||||
|
|
||||||
|
assert(title.trim().isNotEmpty, "Title should not be empty");
|
||||||
|
|
||||||
return "$title - ${track.artists.join(", ")}";
|
return "$title - ${track.artists.join(", ")}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,10 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
final searchedVideos =
|
final searchedVideos =
|
||||||
await ref.read(youtubeEngineProvider).searchVideos(isrc.toString());
|
await ref.read(youtubeEngineProvider).searchVideos(isrc.toString());
|
||||||
if (searchedVideos.isNotEmpty) {
|
if (searchedVideos.isNotEmpty) {
|
||||||
isrcResults.addAll(searchedVideos
|
AppLogger.log
|
||||||
|
.d("${track.title} ISRC $isrc Total ${searchedVideos.length}");
|
||||||
|
|
||||||
|
final filteredMatches = searchedVideos
|
||||||
.map<YoutubeVideoInfo>(YoutubeVideoInfo.fromVideo)
|
.map<YoutubeVideoInfo>(YoutubeVideoInfo.fromVideo)
|
||||||
.map((YoutubeVideoInfo videoInfo) {
|
.map((YoutubeVideoInfo videoInfo) {
|
||||||
final ytWords = videoInfo.title
|
final ytWords = videoInfo.title
|
||||||
@ -225,8 +228,16 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
})
|
})
|
||||||
.whereType<YoutubeVideoInfo>()
|
.nonNulls
|
||||||
.toList());
|
.toList();
|
||||||
|
|
||||||
|
for (final match in filteredMatches) {
|
||||||
|
AppLogger.log.d(
|
||||||
|
"ISRC MATCH: ${match.id} ${match.title} by ${match.channelName} ${match.duration}",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
isrcResults.addAll(filteredMatches);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isrcResults;
|
return isrcResults;
|
||||||
@ -247,7 +258,14 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
videoResults.addAll(isrcResults);
|
videoResults.addAll(isrcResults);
|
||||||
|
|
||||||
if (isrcResults.isEmpty) {
|
if (isrcResults.isEmpty) {
|
||||||
|
AppLogger.log.w("No ISRC results found, falling back to SongLink");
|
||||||
|
|
||||||
final links = await SongLinkService.links(query.id);
|
final links = await SongLinkService.links(query.id);
|
||||||
|
|
||||||
|
for (final link in links) {
|
||||||
|
AppLogger.log.d("SongLink ${query.id} ${link.platform} ${link.url}");
|
||||||
|
}
|
||||||
|
|
||||||
final ytLink = links.firstWhereOrNull(
|
final ytLink = links.firstWhereOrNull(
|
||||||
(link) => link.platform == "youtube",
|
(link) => link.platform == "youtube",
|
||||||
);
|
);
|
||||||
@ -262,6 +280,8 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
// Ignore this error and continue with the search
|
// Ignore this error and continue with the search
|
||||||
AppLogger.reportError(e, stack);
|
AppLogger.reportError(e, stack);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
AppLogger.log.w("No YouTube link found in SongLink results");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
|
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:spotube/services/dio/dio.dart';
|
||||||
|
import 'package:spotube/services/logger/logger.dart';
|
||||||
import 'package:spotube/services/youtube_engine/youtube_engine.dart';
|
import 'package:spotube/services/youtube_engine/youtube_engine.dart';
|
||||||
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
||||||
|
|
||||||
@ -152,9 +155,30 @@ class YouTubeExplodeEngine implements YouTubeEngine {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
return StreamManifest(
|
final accessibleStreams = <AudioOnlyStreamInfo>[];
|
||||||
streamManifest.audioOnly.map((stream) {
|
|
||||||
return AudioOnlyStreamInfo(
|
for (final stream in streamManifest.audioOnly) {
|
||||||
|
// Call dio head request to check if the stream is accessible
|
||||||
|
final response = await globalDio.headUri(
|
||||||
|
stream.url,
|
||||||
|
options: Options(
|
||||||
|
followRedirects: true,
|
||||||
|
validateStatus: (status) {
|
||||||
|
return status != null && status < 500;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
AppLogger.log.d(
|
||||||
|
"Stream $videoId Status ${response.statusCode} Codec ${stream.audioCodec} "
|
||||||
|
"Bitrate ${stream.bitrate} Container ${stream.container}",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode != null &&
|
||||||
|
response.statusCode! >= 200 &&
|
||||||
|
response.statusCode! < 400) {
|
||||||
|
accessibleStreams.add(
|
||||||
|
AudioOnlyStreamInfo(
|
||||||
stream.videoId,
|
stream.videoId,
|
||||||
stream.tag,
|
stream.tag,
|
||||||
stream.url,
|
stream.url,
|
||||||
@ -170,9 +194,12 @@ class YouTubeExplodeEngine implements YouTubeEngine {
|
|||||||
stream.fragments,
|
stream.fragments,
|
||||||
stream.codec,
|
stream.codec,
|
||||||
stream.audioTrack,
|
stream.audioTrack,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}),
|
}
|
||||||
);
|
}
|
||||||
|
|
||||||
|
return StreamManifest(accessibleStreams);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Loading…
Reference in New Issue
Block a user