Skip to content

Commit

Permalink
Shared - Use Preferred Video Codec for Playlists
Browse files Browse the repository at this point in the history
Fixes #892
  • Loading branch information
nlogozzo committed Oct 14, 2024
1 parent 58fc056 commit 6970eb2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libparabolic/src/controllers/mainwindowcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Nickvision::TubeConverter::Shared::Controllers
m_appInfo.setVersion({ "2024.10.2-next" });
m_appInfo.setShortName(_("Parabolic"));
m_appInfo.setDescription(_("Download web video and audio"));
m_appInfo.setChangelog("- Fixed an issue where some websites failed in 403 forbidden error");
m_appInfo.setChangelog("- The user's preferred video codec will now be used in playlist downloads where individual quality/format selection is not available\n- Fixed an issue where some websites failed in 403 forbidden error");
m_appInfo.setSourceRepo("https://github.com/NickvisionApps/Parabolic");
m_appInfo.setIssueTracker("https://github.com/NickvisionApps/Parabolic/issues/new");
m_appInfo.setSupportUrl("https://github.com/NickvisionApps/Parabolic/discussions");
Expand Down
20 changes: 20 additions & 0 deletions libparabolic/src/models/downloadoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,26 @@ namespace Nickvision::TubeConverter::Shared::Models
arguments.push_back("--remux-video");
arguments.push_back(StringHelpers::lower(m_fileType.str()));
}
//Force preferred video codec sorting for playlist downloads to use as format selection is not available
if(downloaderOptions.getPreferredVideoCodec() != VideoCodec::Any)
{
std::string vcodec{ "vcodec:" };
switch (downloaderOptions.getPreferredVideoCodec())
{
case VideoCodec::VP9:
vcodec += "vp9";
break;
case VideoCodec::AV01:
vcodec += "av01";
break;
case VideoCodec::H264:
vcodec += "h264";
break;
}
arguments.push_back("--format-sort");
arguments.push_back(vcodec);
arguments.push_back("--format-sort-force");
}
if(m_videoFormat && m_audioFormat)
{
arguments.push_back("--format");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<releases>
<release version="2024.10.2-next" date="2024-10-13">
<description translate="no">
<p>- The user's preferred video codec will now be used in playlist downloads where individual quality/format selection is not available</p>
<p>- Fixed an issue where some websites failed in 403 forbidden error</p>
</description>
</release>
Expand Down

0 comments on commit 6970eb2

Please sign in to comment.