people abusing it
This commit is contained in:
		
							parent
							
								
									7385448d45
								
							
						
					
					
						commit
						23fdba356e
					
				| 
						 | 
				
			
			@ -127,7 +127,7 @@ exports.playlist = async (ws, req) => {
 | 
			
		|||
 | 
			
		||||
    async function startDownloading() {
 | 
			
		||||
        const playlist = await metadata.getPlaylistVideos(playlistId)
 | 
			
		||||
        for (video of playlist.relatedStreams) {
 | 
			
		||||
        for (video of playlist.relatedStreams.slice(0, 5)) {
 | 
			
		||||
            if (ws.readyState !== ws.OPEN) {
 | 
			
		||||
                return logger.info({ message: `Stopped downloading ${playlistId}, websocket is closed` })
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -233,7 +233,7 @@ exports.channel = async (ws, req) => {
 | 
			
		|||
    async function startDownloading() {
 | 
			
		||||
        const videos = await metadata.getChannelVideos(channelId)
 | 
			
		||||
 | 
			
		||||
        for (video of videos) {
 | 
			
		||||
        for (video of videos.slice(0, 5)) {
 | 
			
		||||
            if (ws.readyState !== ws.OPEN) {
 | 
			
		||||
                return logger.info({ message: `Stopped downloading ${channelId}, websocket is closed` })
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -122,10 +122,7 @@ async function getPlaylistVideos(id) {
 | 
			
		|||
            'User-Agent': 'Mozilla/5.0 (compatible; PreserveTube/0.0; +https://preservetube.com)'
 | 
			
		||||
        }
 | 
			
		||||
    })).json()
 | 
			
		||||
    return {
 | 
			
		||||
        ...json,
 | 
			
		||||
        relatedStreams: json.relatedStreams.slice(0, 5)
 | 
			
		||||
    }
 | 
			
		||||
    return json
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function getVideoDownload(url, quality) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue