Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
2022/11/28公開分の不具合に対応(URLのdir変更)
Browse files Browse the repository at this point in the history
  • Loading branch information
CSReviser authored and CSReviser committed Nov 28, 2022
1 parent 470fd0a commit 34abe83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions downloadthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ QString DownloadThread::formatName( QString format, QString kouza, QString hdate

//--------------------------------------------------------------------------------

bool DownloadThread::captureStream( QString kouza, QString hdate, QString file, QString nendo, QString this_week ) {
bool DownloadThread::captureStream( QString kouza, QString hdate, QString file, QString nendo, QString dir, QString this_week ) {
QString outputDir = MainWindow::outputDir + kouza;
if ( QString::compare( this_week, "今週放送分" ) ==0 ){
outputDir = outputDir + "/" + QString::fromUtf8( "今週放送分" );
Expand Down Expand Up @@ -731,6 +731,8 @@ bool DownloadThread::captureStream( QString kouza, QString hdate, QString file,
dstPath = outputDir + outFileName;
#endif
QString filem3u8a; QString filem3u8b;
if ( dir == "") {prefix1 = prefix1.remove("/mp4"); prefix2 = prefix2.remove("/mp4"); prefix3 = prefix3.remove("/mp4");
} else {prefix1 = prefix1.replace( "mp4", dir ); prefix2 = prefix2.replace( "mp4", dir ); prefix3 = prefix3.replace( "mp4", dir ); };
if ( file.right(4) != ".mp4" ) {
filem3u8a = prefix1 + file + ".mp4/master.m3u8";
filem3u8b = prefix2 + file + ".mp4/master.m3u8";
Expand Down Expand Up @@ -1114,11 +1116,12 @@ void DownloadThread::run() {
QStringList kouzaList = getAttribute( prefix + paths[i] + "/" + suffix, "@kouza" );
QStringList hdateList = one2two( getAttribute( prefix + paths[i] + "/" + suffix, "@hdate" ) );
QStringList nendoList = getAttribute( prefix + paths[i] + "/" + suffix, "@nendo" );

QStringList dirList = getAttribute( prefix + paths[i] + "/" + suffix, "@dir" );

if ( fileList.count() && fileList.count() == kouzaList.count() && fileList.count() == hdateList.count() ) {
if ( true /*ui->checkBox_this_week->isChecked()*/ ) {
for ( int j = 0; j < fileList.count() && !isCanceled; j++ ){
captureStream( kouzaList[j], hdateList[j], fileList[j], nendoList[j], "今週公開分" );
captureStream( kouzaList[j], hdateList[j], fileList[j], nendoList[j], dirList[j], "今週公開分" );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion downloadthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DownloadThread : public QThread {
bool checkOutputDir( QString dirPath );
void downloadENews( bool re_read );

bool captureStream( QString kouza, QString hdate, QString file, QString nendo, QString this_week );
bool captureStream( QString kouza, QString hdate, QString file, QString nendo, QString dir, QString this_week );
bool captureStream_json( QString kouza, QString hdate, QString file, QString nendo, QString title, QString this_week );

QString formatName( QString format, QString kouza, QString hdate, QString file, QString nendo, bool checkIllegal );
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace {
// int day = regexp.cap( 2 ).toInt();
// result = QString( " (%1/%2/%3)" ).arg( regexp.cap( 3 ) )
// .arg( month, 2, 10, QLatin1Char( '0' ) ).arg( day, 2, 10, QLatin1Char( '0' ) );
result = QString( " (2022/11/20)" );
result = QString( " (2022/11/28)" );
}
return result;
}
Expand Down

0 comments on commit 34abe83

Please sign in to comment.