diff options
author | sijanec <anton@sijanec.eu> | 2021-01-07 10:10:19 +0100 |
---|---|---|
committer | sijanec <anton@sijanec.eu> | 2021-01-07 10:10:19 +0100 |
commit | e89f123b2ba9e9792a84e783b1f185c7bd905f6d (patch) | |
tree | d46dcaacbacc91abcc92deacd80a10f6eb3cec42 /rtv4d-dl.c | |
parent | popravek prejšnjega commita (diff) | |
download | rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar.gz rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar.bz2 rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar.lz rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar.xz rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.tar.zst rtv4d-dl-e89f123b2ba9e9792a84e783b1f185c7bd905f6d.zip |
Diffstat (limited to 'rtv4d-dl.c')
-rw-r--r-- | rtv4d-dl.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -47,6 +47,7 @@ do { if ( RTV_NAPISI_ ##kaj ) fprintf(stderr, \ "[" #kaj "] %s@%s:" NIZ(__LINE__) " " frmt "\n", \ __func__, __FILE__, ##__VA_ARGS__ ); } while(0); +#define RTV_VER "0.0.6" #define RTV_USER_AGENT "Mozilla/5.0 equivalent (rtv4d-dl " RTV_VER "; C " \ NIZ(__STDC_VERSION__) " GCC " __VERSION__ "; " __DATE__ " " __TIME__ "; " \ __FILE__ ":" NIZ(__LINE__) ")" @@ -65,7 +66,6 @@ #define RTV_JWT_SIZEOF 43+1 #define RTV_PREDVAJALNIK_URL "http://4d." RTV_SLD "/arhiv/v/%u" #define RTV_PREDVAJALNIK_URL_SIZEOF (32+1 + 12) -#define RTV_VER "0.0.5" #define RTV_ZIVO_PROGRAM_SIZEOF 12 #define RTV_API_ZIVO_URL \ "http://api." RTV_SLD "/ava/getLiveStream/tv.%." \ @@ -132,6 +132,8 @@ "prenehajte uporabljati program s Ctrl-C! naslovi so bili spremenjeni, " \ "tako da bo prenos še vedno deloval, če pa ne, pa poglejte navodila."); \ } +#define RTV_ZIVO_KAZ_POSK 12 +#define RTV_ZIVO_KAZ_POSK_SPANJE 1 struct meta_oddaja { size_t naslov_sizeof; char * naslov; /* Vreme ob 22h */ @@ -478,8 +480,12 @@ int rtv_zivo_izpolni(struct rtv_zivo_meta * m) { RTV_HTTPS_V_HTTP(m->seznam_predvajanja_url); RTV_JSON(odg, sizeloc, "\"streamer\"", m->kazalo_url, s, '"', NULL); RTV_JSON(odg, sizeloc, "\"streamer\"", m->kos_format, s, '"', NULL); - m->kazalo_url[strlen(m->kazalo_url)] = '/'; /* ja, allocata se dodaten ram */ - m->kos_format[strlen(m->kos_format)] = '/'; /* ja, allocata se dodaten ram */ + i = strlen(m->kazalo_url); + m->kazalo_url[i++] = '/'; /* ja, allocata se dodaten ram */ + m->kazalo_url[i] = '\0'; + i = strlen(m->kos_format); + m->kos_format[i++] = '/'; /* ja, allocata se dodaten ram */ + m->kos_format[i] = '\0'; RTV_HTTPS_V_HTTP(m->kazalo_url); RTV_JSON(odg, sizeloc, "\"file\"", temp, s, '"', NULL); m->seznam_predvajanja_url_sizeof = @@ -515,6 +521,11 @@ int rtv_zivo_izpolni(struct rtv_zivo_meta * m) { #ifndef RTV_NASTAVITEV_BREZ_LOKACIJSKIH_SPREMEMB RTV_INT_V_SLO(m->kazalo_url); #endif + e = strstr(m->kazalo_url, "_DVR"); + if (e != NULL) { + memmove(e, e+strlen("_DVR"), strlen("_DVR")+1); + RTV_NAPISI(HROSC, "RTV je poslal DVR, čeprav ga nočemo. popravil sem."); + } RTV_NAPISI(HROSC, "kazalo_url => %s", m->kazalo_url); rewind(odgstream); returnstatus = http_get(m->kazalo_url, odgstream); @@ -542,8 +553,7 @@ int rtv_zivo_izpolni(struct rtv_zivo_meta * m) { m->prvi = atoi(e+strlen("#EXT-X-MEDIA-SEQUENCE:")); /* prvi v kazalu */ RTV_NAPISI(HROSC, "našel sekvenčno številko %u", m->prvi); } else { - RTV_NAPISI(NAPAKA, "pri iskanju MEDIA-SEQUENCE: ne morem narediti formata" - ". poskusite znova nekajkrat. je RTV strežnik spet GZIPpal? :shrug:"); + RTV_NAPISI(NAPAKA, "pri iskanju MEDIA-SEQUENCE: ne morem narediti formata"); returnstatus = 2; goto rtv_zivo_izpolni_returncleanly; } @@ -901,7 +911,7 @@ int main (int argc, char ** argv) { fprintf(stdout, "številka prvega kosa (z->prvi) je po novem %u\n", i); } - sleep(1); + sleep(9); } default: RTV_NAPISI(NAPAKA, "opcija (%c/%u) ne obstaja!", |