yne / dzr

Accountless deezer.com Player (CLI & VSCode)
The Unlicense
199 stars 12 forks source link

play all /track/ - basename: File name too long #33

Open karawitan opened 1 year ago

karawitan commented 1 year ago

Hi !

when using "play all /track/" feature, sometimes we hit the following issue:

./dzr /playlist/1787912442
api.deezer.com/playlist/1787912442
basename: /track/2281056027,2266763737,2287896687,2131523607,2248085207,2246363927,2270565757,2245376117,1935086447,2253072387,2256592497,2080576707,2157441547,2203820017,2207586097,2207828837,2243144017,2180282227,2221484027,2218419137,2216744097,2109832137,2201097047,2150231437,2215414617,2215414577,2222853877,2178291237,2139669
997,2203539917,2126567267,2171638707,2180475927,2210505667,2203905957,2199511237,2199511407,2138079857,2217015567,2171638427,2203924267,2185771617,2222103627,2184287407,2188772417,2188773747,2145056377,2180444147,2173805817,2186390487,2186364127,2148067567,2141852857,2172250647,2202754257,2185136087,2106118067,2073869907,2102372407,2106118007,2056560807,2070538977,543154992,963634872,647285422,762031082,920225242,509935492,671866752,2050209967,603864332,142582988,843074082,779649652,833662452,
663960482,705198642,73025612,854317202,984764002,490837772,1094551682,690232992,141767545,561228682,676134342,1130307782,963360212,846974362,413690882,1047043512,593716292,1053322872,1073793242,569093082,1100680432,626181052,705146582,790056522,492908952,855954952,2087658327,2170067147,2148863537,2192809047,2189048737,2185138147,2185020287,2185020247,2169497107,2140584937,2177978917,2162007397,2143869057,2160459167,2188915417,2154890617,2159271357,2126530457,2067619607,2126782127,2177981647,2148651807,2185024757,2168072997,2185023617,2168088587,2151995817,2044631957,2148651837,2148648417,2148651817,1759180747,2144049837,2107658627,2139411977,2145356987,2133359797,2174198487,2157531827,2174326377,1938301697,2174327947,2174327957,2174328427,2149128267,2124994317,2143001497,1988630697,2147851397,2147849207,2150165527,2141334967,2140560677,2154340897,2141847597,2124564427,2130915877,2130902377,2130920357,2130902557,2148218847,2116184467,2164414227,2144428007,2144509227,2144509247,2144510397,2144510437,2144510387,2139857027,2138378487,2138135567,2138080077,2000292327,2135303177,2153936927,2153937117,2153937177,2153936887,2153937167,2014672367,1963980927,2142304967,2124554147,2121711487,2121711477,2108669147,2129563047,2017380577,1975852597,2119743407,2128970577,2089146157,2106216387,2087702927,2133132477,1937289337,2071478117: File name too long

Will try to implement a fix

karawitan commented 1 year ago

Giving a string whose size is > 1024 on macosx 13.3.1 to /usr/bin/basename triggers "basename: File name too long" issue.

yne commented 1 year ago

maybe sed could be used instead ?

karawitan commented 1 year ago

Ok so simply replacing xargs basename with sed 's#/[^/]*/##' should fix it. However, I'm facing another issue that I don't understand, and am able to validate the fix :)