ByteRange { get; set; }
16 | public double Duration { get; set; }
17 | public Uri? KeyUrl { get; set; }
18 | public string? IV { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/chrome/disabled.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | XDM Browser Monitor
10 |
11 |
12 |
Browser monitoring is disabled in XDM
13 |
XDM is running but browser monitoring is disabled in XDM
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox/disabled.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | XDM Browser Monitor
10 |
11 |
12 |
Browser monitoring is disabled in XDM
13 |
XDM is running but browser monitoring is disabled in XDM
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox-old/disabled.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | XDM Browser Monitor
10 |
11 |
12 |
Browser monitoring is disabled in XDM
13 |
XDM is running but browser monitoring is disabled in XDM
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/ILinkRefresher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using XDM.Core.Downloader.Progressive;
3 | using XDM.Core.Downloader.Progressive.DualHttp;
4 | using XDM.Core.Downloader.Progressive.SingleHttp;
5 |
6 | namespace XDM.Core
7 | {
8 | public interface ILinkRefresher
9 | {
10 | event EventHandler? RefreshedLinkReceived;
11 |
12 | void AddToWatchList(HTTPDownloaderBase downloader);
13 | void ClearWatchList();
14 | bool LinkAccepted(Message message);
15 | bool LinkAccepted(SingleSourceHTTPDownloadInfo info);
16 | bool LinkAccepted(DualSourceHTTPDownloadInfo info);
17 | }
18 | }
--------------------------------------------------------------------------------
/app/XDM/xdm-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/translation-generator/translation-gen/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/Progressive/SingleHttp/SingleSourceHTTPDownloadInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 |
4 | namespace XDM.Core.Downloader.Progressive.SingleHttp
5 | {
6 | public class SingleSourceHTTPDownloadInfo: IRequestData
7 | {
8 | public string Uri { get; set; }
9 | public string? Cookies { get; set; }
10 | public Dictionary> Headers { get; set; }
11 | public string File { get; set; }
12 | public long ContentLength { get; set; }
13 | public bool ConvertToMp3 { get; set; }
14 | public string ContentType { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IQueuesWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using XDM.Core;
4 | using XDM.Core.UI;
5 |
6 | namespace XDM.Core.UI
7 | {
8 | public interface IQueuesWindow
9 | {
10 | event EventHandler? QueuesModified;
11 | event EventHandler? QueueStartRequested;
12 | event EventHandler? QueueStopRequested;
13 | event EventHandler? WindowClosing;
14 |
15 | void RefreshView();
16 | void SetData(IEnumerable queues);
17 | void ShowWindow(object window);
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/app/XDM/XDM.Gtk.UI/svg-icons/xdm-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/translation-generator/translation-gen/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 | import 'bootstrap/dist/css/bootstrap.min.css';
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
15 | // If you want to start measuring performance in your app, pass a function
16 | // to log results (for example: reportWebVitals(console.log))
17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
18 | reportWebVitals();
19 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/CategoryEntry.cs:
--------------------------------------------------------------------------------
1 | using XDM.Core;
2 |
3 | namespace XDM.Wpf.UI
4 | {
5 | internal class CategoryWrapper
6 | {
7 | public readonly Category? category;
8 | public bool IsTopLevel { get; set; }
9 | public string? DisplayName { get; set; }
10 | public string VectorIcon { get; set; }
11 | public CategoryWrapper(Category category)
12 | {
13 | this.category = category;
14 | }
15 | public CategoryWrapper()
16 | {
17 | }
18 | public string? Name
19 | => category?.DisplayName ?? category?.Name ?? DisplayName;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/Chunk.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace XDM.Core.Downloader
4 | {
5 | public class Chunk
6 | {
7 | public Uri Uri { get; set; }
8 | public long Size { get; set; }
9 | public long Offset { get; set; }
10 | public string Id { get; set; }
11 | public ChunkState ChunkState { get; set; }
12 | public long Downloaded { get; set; }
13 |
14 | public Chunk()
15 | {
16 | this.ChunkState = ChunkState.Ready;
17 | }
18 | }
19 |
20 | public enum ChunkState
21 | {
22 | Ready, FailedFatal, FailedTransient, InProgress, Finished
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/XDM/FFmpegCustomBuild/ffmpeg_options.txt:
--------------------------------------------------------------------------------
1 | # Lines starting with this character are ignored
2 | # To override some options specifically for the shared build, create a ffmpeg_options_shared.txt file.
3 |
4 | # Basic built-in options, can be removed if you delete "--disable-autodetect"
5 | --disable-everything
6 | --disable-network
7 | --disable-autodetect
8 | --enable-small
9 | --enable-demuxer=mov,mp4,m4a,3gp,3g2,mj2,matroska,webm,mpegts
10 | --enable-libmp3lame
11 | --enable-encoder=libmp3lame
12 | --enable-muxer=mp4,matroska,mpegts,mp3,webm
13 | --enable-protocol=file,srt,concat
14 | --enable-bsfs
15 | --enable-filter=acopy,concat,copy
16 | --enable-decoder=vorbis,opus,aac,ac3
17 |
--------------------------------------------------------------------------------
/.github/workflows/xdm-wpf-build.yml:
--------------------------------------------------------------------------------
1 | name: .NET
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: windows-latest
13 |
14 | defaults:
15 | run:
16 | working-directory: ./app/XDM/XDM.Wpf.UI/
17 |
18 | steps:
19 | - uses: actions/checkout@v3
20 | - name: Setup .NET
21 | uses: actions/setup-dotnet@v2
22 | with:
23 | dotnet-version: 6.0.x
24 | - name: Restore dependencies
25 | run: dotnet restore
26 | - name: Build
27 | run: dotnet build --no-restore
28 | - name: Test
29 | run: dotnet test --no-build --verbosity normal
30 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/new_browser_ext/lib/logger.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | export default class Logger {
3 | constructor() {
4 | this.loggingEnabled = true;
5 | let manifest = null;
6 | if (chrome && chrome.runtime && chrome.runtime.getManifest) {
7 | manifest = chrome.runtime.getManifest();
8 | } else if (runtime && runtime.getManifest) {
9 | manifest = chrome.getManifest();
10 | }
11 | if (manifest) {
12 | this.loggingEnabled = !manifest.update_url;
13 | }
14 | }
15 |
16 | log(content) {
17 | if (this.loggingEnabled) {
18 | console.log(content);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/translation-generator/translation-gen/src/TextInput.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import './TextInput.css';
3 | function TextInput(props) {
4 | function handleChange(event) {
5 | props.updateMappings(props.keyName, event.target.value);
6 | }
7 | return (
8 |
9 |
14 |
15 | );
16 | }
17 |
18 | export default TextInput;
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/DataAccess/Extensions/DataReaderExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SQLite;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace XDM.Core.DataAccess.Extensions
8 | {
9 | public static class DataReaderExtensions
10 | {
11 | public static string GetSafeString(this SQLiteDataReader r, int index)
12 | {
13 | if (!r.IsDBNull(index))
14 | {
15 | return r.GetString(index);
16 | }
17 | #pragma warning disable CS8603 // Possible null reference return.
18 | return null;
19 | #pragma warning restore CS8603 // Possible null reference return.
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/XDM/XDM.WinForms.IntegrationUI/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace XDM.WinForms.IntegrationUI
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | //Application.SetHighDpiMode(HighDpiMode.SystemAware);
18 | Application.EnableVisualStyles();
19 | Application.SetCompatibleTextRenderingDefault(false);
20 | Application.Run(new Form1());
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/XDM/chrome-extension/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "XDM Integration Module",
3 | "action": {},
4 | "manifest_version": 3,
5 | "version": "3.3",
6 | "description": "Download with Xtreme Download Manager.",
7 | "host_permissions": [
8 | "*://*/*"
9 | ],
10 | "permissions": [
11 | "downloads",
12 | "cookies",
13 | "webRequest",
14 | "tabs",
15 | "storage",
16 | "contextMenus",
17 | "alarms"
18 | ],
19 | "background": {
20 | "service_worker": "main.js",
21 | "type": "module"
22 | },
23 | "icons": {
24 | "16": "icon16.png",
25 | "48": "icon48.png",
26 | "128": "icon128.png"
27 | }
28 | }
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Win32/WpfToWinformWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Interop;
7 |
8 | namespace XDM.Wpf.UI.Win32
9 | {
10 | internal class WinformsWindow
11 | : System.Windows.Forms.IWin32Window
12 | {
13 | IntPtr _handle;
14 |
15 | public WinformsWindow(Window window)
16 | {
17 | _handle = new WindowInteropHelper(window).Handle;
18 | }
19 |
20 | #region IWin32Window Members
21 |
22 | IntPtr System.Windows.Forms.IWin32Window.Handle
23 | {
24 | get { return _handle; }
25 | }
26 |
27 | #endregion
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox-old/fatal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | XDM Browser Monitor
10 |
11 |
12 |
Browser monitoring is disabled
13 |
Please make sure XDM is runnning and you have latest version of XDM installed, This addon is compatible with XDM
14 | 7.0 or higher
15 |
Download XDM
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IInProgressDownloadRow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using XDM.Core;
7 |
8 | namespace XDM.Core.UI
9 | {
10 | public interface IInProgressDownloadRow
11 | {
12 | public string FileIconText { get; }
13 |
14 | public string Name { get; set; }
15 |
16 | public long Size { get; set; }
17 |
18 | public DateTime DateAdded { get; set; }
19 |
20 | public int Progress { get; set; }
21 |
22 | public DownloadStatus Status { get; set; }
23 |
24 | public string DownloadSpeed { get; set; }
25 |
26 | public string ETA { get; set; }
27 |
28 | public InProgressDownloadItem DownloadEntry { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/CountdownLatch.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 |
4 | namespace XDM.Core.Downloader
5 | {
6 | public class CountdownLatch
7 | {
8 | private ManualResetEvent Latch { get; } = new ManualResetEvent(false);
9 | private int counter;
10 |
11 | public CountdownLatch(int counter)
12 | {
13 | this.counter = counter;
14 | }
15 |
16 | public void CountDown()
17 | {
18 | Interlocked.Decrement(ref counter);
19 | if (counter == 0) this.Latch.Set();
20 | }
21 |
22 | public void Wait()
23 | {
24 | Latch.WaitOne();
25 | }
26 |
27 | public void Break()
28 | {
29 | Latch.Set();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/translation-generator/translation-gen/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | display: flex;
3 | flex-direction: column;
4 | padding: 10px;
5 | }
6 |
7 | .App-logo {
8 | height: 40vmin;
9 | pointer-events: none;
10 | }
11 |
12 | @media (prefers-reduced-motion: no-preference) {
13 | .App-logo {
14 | animation: App-logo-spin infinite 20s linear;
15 | }
16 | }
17 |
18 | .App-header {
19 | background-color: #282c34;
20 | min-height: 100vh;
21 | display: flex;
22 | flex-direction: column;
23 | align-items: center;
24 | justify-content: center;
25 | font-size: calc(10px + 2vmin);
26 | color: white;
27 | }
28 |
29 | .App-link {
30 | color: #61dafb;
31 | }
32 |
33 | @keyframes App-logo-spin {
34 | from {
35 | transform: rotate(0deg);
36 | }
37 |
38 | to {
39 | transform: rotate(360deg);
40 | }
41 | }
--------------------------------------------------------------------------------
/app/XDM/firefox-amo/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "XDM v8+ Browser Helper",
3 | "browser_action": {},
4 | "manifest_version": 2,
5 | "version": "1.4",
6 | "description": "Download files with XDM v8+",
7 | "permissions": [
8 | "tabs",
9 | "cookies",
10 | "contextMenus",
11 | "menus",
12 | "activeTab",
13 | "webRequest",
14 | "webRequestBlocking",
15 | "*://*/*"
16 | ],
17 | "background": {
18 | "page": "main.html"
19 | },
20 | "icons": {
21 | "16": "icon16.png",
22 | "48": "icon48.png",
23 | "128": "icon128.png"
24 | },
25 | "browser_specific_settings": {
26 | "gecko": {
27 | "id": "xdm-v8-browser-helper@subhra74.github.io"
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Common/ValueConverters/FileSizeValueConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Data;
7 | using XDM.Core.Util;
8 |
9 | namespace XDM.Wpf.UI
10 | {
11 | [ValueConversion(typeof(long), typeof(string))]
12 | internal class FileSizeValueConverter : IValueConverter
13 | {
14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | return FormattingHelper.FormatSize((long)value);
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | throw new NotImplementedException();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/Settings/CategoryFileTypesConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Data;
7 |
8 | namespace XDM.Wpf.UI.Dialogs.Settings
9 | {
10 | [ValueConversion(typeof(IEnumerable), typeof(string))]
11 | internal class CategoryFileTypesConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return string.Join(",", ((IEnumerable)value).ToArray());
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | throw new NotImplementedException();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/XDM/MockServer/MockServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0;
5 | AnyCPU;x86;x64
6 | 9.0
7 | enable
8 |
9 |
10 |
11 | none
12 | false
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IDownloadCompleteDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 |
7 | namespace XDM.Core.UI
8 | {
9 | public interface IDownloadCompleteDialog
10 | {
11 | public event EventHandler? FileOpenClicked;
12 | public event EventHandler? FolderOpenClicked;
13 | public event EventHandler? DontShowAgainClickd;
14 |
15 | public string FileNameText { get; set; }
16 | public string FolderText { get; set; }
17 | public void ShowDownloadCompleteDialog();
18 | }
19 |
20 | public class DownloadCompleteDialogEventArgs : EventArgs
21 | {
22 | public string? Path { get; set; }
23 | public string? FileName { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/XDM/chrome-extension/error.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | XDM Integration Module
11 |
12 |
13 |
14 |
Unable to connect with XDM, please make sure XDM is running
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/XDM/firefox-amo/app/error.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | XDM Integration Module
11 |
12 |
13 |
14 |
Unable to connect with XDM, please make sure XDM is running
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Compatibility/DictionaryExtensions.cs:
--------------------------------------------------------------------------------
1 | #if !NET5_0_OR_GREATER
2 |
3 | using System.Collections.Generic;
4 |
5 | namespace XDM.Compatibility
6 | {
7 | public static class DictionaryExtensions
8 | {
9 | public static V GetValueOrDefault(this Dictionary dict, K key, V defaultValue)
10 | {
11 | if (dict.TryGetValue(key, out V value))
12 | {
13 | return value;
14 | }
15 | return defaultValue;
16 | }
17 |
18 | public static V GetValueOrDefault(this Dictionary dict, K key)
19 | {
20 | #pragma warning disable CS8604 // Possible null reference argument.
21 | return dict.GetValueOrDefault(key, default);
22 | #pragma warning restore CS8604 // Possible null reference argument.
23 | }
24 | }
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/ValueConverters/FileExtensionToVectorImageConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 | using System.Windows.Media;
6 | using XDM.Core.UI;
7 |
8 | namespace XDM.Wpf.UI
9 | {
10 | [ValueConversion(typeof(string), typeof(Geometry))]
11 | internal class FileExtensionToVectorImageConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return Application.Current.TryFindResource(IconMap.GetVectorNameForFileType(value as string));
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | throw new NotImplementedException();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/XDM/NativeMessaging/NativeMessaging.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | ec82d5e3-4a98-4fbf-be18-88a085d12290
7 |
8 |
9 | NativeMessaging
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Common/Helpers/SelectionHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Controls;
6 |
7 | namespace XDM.Wpf.UI.Common.Helpers
8 | {
9 | internal static class SelectionHelper
10 | {
11 | public static int[] GetSelectedIndices(this ListView lv)
12 | {
13 | if (lv.SelectedItems.Count < 1) return new int[0];
14 | var list = new List(lv.SelectedItems.Count);
15 | var selectedItems = lv.SelectedItems;
16 | var allItems = lv.Items;
17 | for (int i = 0; i < selectedItems.Count; i++)
18 | {
19 | var index = allItems.IndexOf(selectedItems[i]);
20 | list.Add(index);
21 | }
22 | list.Sort();
23 | return list.ToArray();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/ValueConverters/ListViewDateConverter.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Globalization;
4 | //using System.Linq;
5 | //using System.Text;
6 | //using System.Windows.Data;
7 |
8 | //namespace XDM.Wpf.UI.MainWindow.ValueConverters
9 | //{
10 | // //[ValueConversion(typeof(DateTime), typeof(string))]
11 | // //internal class ListViewDateConverter : IValueConverter
12 | // //{
13 | // // public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | // // {
15 | // // var date = (DateTime)value;
16 | // // if(date)
17 | // // }
18 |
19 | // // public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | // // {
21 | // // throw new NotImplementedException();
22 | // // }
23 | // //}
24 | //}
25 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/Progressive/DualHttp/DualSourceHTTPDownloadInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 |
4 | namespace XDM.Core.Downloader.Progressive.DualHttp
5 | {
6 | public class DualSourceHTTPDownloadInfo : IRequestData
7 | {
8 | public string Uri1 { get; set; }
9 | public string Uri2 { get; set; }
10 | public string? Cookies1 { get; set; }
11 | public string? Cookies2 { get; set; }
12 | public Dictionary> Headers1 { get; set; }
13 | public Dictionary> Headers2 { get; set; }
14 | public string File { get; set; }
15 | public long ContentLength { get; set; }
16 | public long ContentLength1 { get; set; }
17 | public long ContentLength2 { get; set; }
18 | public string ContentType1 { get; set; }
19 | public string ContentType2 { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/ChromeIntegrator/Page2.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 | using System.Windows.Media.Imaging;
4 | using XDM.Core.BrowserMonitoring;
5 |
6 | namespace XDM.Wpf.UI.Dialogs.ChromeIntegrator
7 | {
8 | ///
9 | /// Interaction logic for Page2.xaml
10 | ///
11 | public partial class Page2 : UserControl
12 | {
13 | public Browser Browser
14 | {
15 | set
16 | {
17 | this.Img.Source = new BitmapImage(
18 | new Uri(
19 | System.IO.Path.Combine(
20 | System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "images"),
21 | $"load_unpacked.jpg")));
22 | }
23 | }
24 | public Page2()
25 | {
26 | InitializeComponent();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/ValueConverters/FileExtensionToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 | using System.Windows.Media;
6 | using XDM.Core.UI;
7 |
8 | namespace XDM.Wpf.UI
9 | {
10 | [ValueConversion(typeof(string), typeof(SolidColorBrush))]
11 | internal class FileExtensionToColorConverter : IValueConverter
12 | {
13 | public object Convert(object? value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | var res = IconMap.GetVectorNameForFileType(value as string);
16 | return Application.Current.TryFindResource("color-" + res);
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | throw new NotImplementedException();
22 | }
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Clients/Http/IHttpClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using XDM.Core;
6 |
7 | namespace XDM.Core.Clients.Http
8 | {
9 | public interface IHttpClient : IDisposable
10 | {
11 | public TimeSpan Timeout { get; set; }
12 |
13 | public HttpRequest CreateGetRequest(Uri uri,
14 | Dictionary>? headers = null,
15 | string? cookies = null,
16 | AuthenticationInfo? authentication = null);
17 |
18 | public HttpRequest CreatePostRequest(Uri uri,
19 | Dictionary>? headers = null,
20 | string? cookies = null,
21 | AuthenticationInfo? authentication = null,
22 | byte[]? body = null);
23 |
24 | public HttpResponse Send(HttpRequest request);
25 | public void Close();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/INewDownloadDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using XDM.Core.UI;
6 |
7 | namespace XDM.Core.UI
8 | {
9 | public interface INewDownloadDialog : IFileSelectable
10 | {
11 | void SetFileSizeText(string text);
12 | void DisposeWindow();
13 | void Invoke(Action callback);
14 | void ShowWindow();
15 | void ShowMessageBox(string message);
16 | string Url { get; set; }
17 | AuthenticationInfo? Authentication { get; set; }
18 | ProxyInfo? Proxy { get; set; }
19 | int SpeedLimit { get; set; }
20 | bool EnableSpeedLimit { get; set; }
21 | event EventHandler DownloadClicked, DestroyEvent,
22 | UrlChangedEvent, UrlBlockedEvent, QueueSchedulerClicked;
23 | event EventHandler DownloadLaterClicked;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/XDM/XDM_Tests/GenericTests.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using XDM.Core.Lib.Common;
8 | using XDM.Core.Lib.Common.Collections;
9 |
10 | namespace XDM.SystemTests
11 | {
12 | class GenericTests
13 | {
14 | [Test]
15 | public void TestGenericOrderDictionary()
16 | {
17 | var dict = new GenericOrderedDictionary();
18 | dict.Add("Hello", true);
19 | dict.Add("Heeelllllo", true);
20 | dict.Add("World", false);
21 | foreach (var key in dict.Keys)
22 | {
23 | Console.WriteLine(key + " " + dict[key]);
24 | }
25 | Console.WriteLine("First: "+dict.First());
26 | Console.WriteLine("Last: " + dict.Last());
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Compatibility/StreamExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace XDM.Compatibility
8 | {
9 | public static class StreamExtension
10 | {
11 | public static void CopyTo(this Stream stream, Stream destination)
12 | {
13 | #if NET35
14 | var buffer = new byte[8192];
15 | #else
16 | var buffer = System.Buffers.ArrayPool.Shared.Rent(8192);
17 | #endif
18 | try
19 | {
20 | int read;
21 | while ((read = stream.Read(buffer, 0, buffer.Length)) != 0)
22 | destination.Write(buffer, 0, read);
23 | }
24 | finally
25 | {
26 | #if !NET35
27 | System.Buffers.ArrayPool.Shared.Return(buffer);
28 | #endif
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/ValueConverters/CategoryToVectorImageConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using XDM.Core.UI;
10 |
11 | namespace XDM.Wpf.UI
12 | {
13 | [ValueConversion(typeof(string), typeof(Geometry))]
14 | internal class CategoryToVectorImageConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | var geom = Application.Current.TryFindResource(value);
19 | return geom;
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Util/ExtensionRegistrationHelper.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.IO;
4 | //using System.Text;
5 |
6 | //namespace XDM.Core.Util
7 | //{
8 | // public static class ExtensionRegistrationHelper
9 | // {
10 | // public static void AddExtension(string extension)
11 | // {
12 | // if (!extension.EndsWith("/"))
13 | // {
14 | // extension += "/";
15 | // }
16 | // var file = Path.Combine(Config.AppDir, "extension.txt");
17 | // var extensions = new List();
18 | // if (File.Exists(file))
19 | // {
20 | // extensions.AddRange(File.ReadAllLines(file));
21 | // }
22 | // extensions.Add(extension);
23 | // var set = new HashSet(extensions);
24 | // File.WriteAllLines(file, set);
25 | // }
26 | // }
27 | //}
28 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/chrome/fatal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | XDM Browser Monitor
11 |
12 |
13 |
Browser monitoring is disabled
14 |
Please make sure XDM is runnning and you have latest version of XDM installed, This addon is
15 | compatible with XDM
16 | 7.0 or higher
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/XDM/XDM_Tests/XDM.SystemTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0;
5 | AnyCPU;x86;x64
6 | 9.0
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox/fatal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | XDM Browser Monitor
11 |
12 |
13 |
Browser monitoring is disabled
14 |
Please make sure XDM is runnning and you have latest version of XDM installed, This addon is
15 | compatible with XDM
16 | 7.0 or higher
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/BrowserMonitoring/ExtensionData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace XDM.Core.BrowserMonitoring
6 | {
7 | public class ExtensionData
8 | {
9 | public string Url { get; set; }
10 | public string Cookie { get; set; }
11 | public Dictionary> RequestHeaders { get; set; }
12 | public Dictionary> ResponseHeaders { get; set; }
13 | public string File { get; set; }
14 | public string Method { get; set; }
15 | public string UserAgent { get; set; }
16 | public string TabUrl { get; set; }
17 | public string TabId { get; set; }
18 | public string TabTitle { get; set; }
19 | public string Referer { get; set; }
20 | public long? FileSize { get; set; }
21 | public string MimeType { get; set; }
22 | public string Vid { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/XDM/Lang/index.txt:
--------------------------------------------------------------------------------
1 | English=English.txt
2 | Arabic (العربية)=Arabic.txt
3 | Chinese simplified (简体中文)=Chinese simplified.txt
4 | Chinese Traditional (繁體中文)=Chinese Traditional.txt
5 | Czech=Czech.txt
6 | Farsi - Persian (فارسی)=Farsi-Persian.txt
7 | French(Français)=French.txt
8 | German(Deutsch)=German.txt
9 | Hungarian=Hungarian.txt
10 | Indonesian (Bahasa Indonesia)=Indonesian.txt
11 | Italian=Italian.txt
12 | Korea (한국어)=Korea.txt
13 | Malayalam=Malayalam.txt
14 | Nepali=Nepali.txt
15 | Polish=Polish.txt
16 | Portuguese Brazil (Português (Brasil))=Portuguese Brazil.txt
17 | Romanian (ROMÂNĂ)=Romanian.txt
18 | Russian(Rусский)=Russian.txt
19 | Serbian - Latin (Srpski (latinica))=Serbian - Latin.txt
20 | Serbian Cyrillic (Српски (ћирилица))=Serbian Cyrillic.txt
21 | Spanish (Español)=Spanish.txt
22 | Traditional Chinese - Taiwan (繁體中文(台灣))=Traditional Chinese - Taiwan.txt
23 | Turkish(Türkçe)=Turkish.txt
24 | Ukrainian(Українська)=Ukrainian.txt
25 | Vietnamese=Vietnamese.txt
--------------------------------------------------------------------------------
/app/XDM/NativeMessagingHost/App.PostDotNet4.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Win.Installer/make-silent-msi.bat:
--------------------------------------------------------------------------------
1 | set BUILD_VER=8.0.14
2 |
3 | DEL /s /q *.wixobj
4 | DEL /s /q net4.6.0.wxs
5 | RMDIR /S /Q BIN
6 | RMDIR /S /Q xdm-helper-chrome
7 |
8 | MKDIR BIN
9 | MKDIR BIN\chrome-extension
10 | MKDIR BIN\ext-loader
11 | MKDIR BIN\XDM.App.Host
12 |
13 | dotnet build -c Release -f net4.6.0 ..\XDM.Wpf.UI\XDM.Wpf.UI.csproj -o BIN
14 | dotnet build -c Release -f net4.6.0 ..\XDM.App.Host\XDM.App.Host.csproj -o BIN\XDM.App.Host
15 |
16 | copy /B ffmpeg-x86.exe BIN
17 | git clone https://github.com/subhra74/xdm-helper-chrome.git
18 |
19 | xcopy /E xdm-helper-chrome\chrome\chrome-extension BIN\chrome-extension
20 | xcopy /E xdm-helper-chrome\ext-loader BIN\ext-loader
21 |
22 | heat dir BIN -o net4.6.0.wxs -scom -frag -srd -sreg -gg -cg NET460 -dr INSTALLFOLDER
23 |
24 | candle silent.wxs net4.6.0.wxs
25 | light -ext WixUIExtension -ext WixUtilExtension -cultures:en-us silent.wixobj net4.6.0.wixobj -b BIN -out xdmsetup-%BUILD_VER%-x86.msi
26 |
27 |
--------------------------------------------------------------------------------
/app/XDM/NativeMessagingHost/BlockingCollection.cs:
--------------------------------------------------------------------------------
1 | #if NET35
2 |
3 | using System.Collections.Generic;
4 | using System.Threading;
5 |
6 | namespace NetFX.Polyfill2
7 | {
8 | public class BlockingCollection
9 | {
10 | private object _queueLock = new();
11 | private Queue _queue = new();
12 | private AutoResetEvent _objectAvailableEvent = new(false);
13 |
14 | public T Take()
15 | {
16 | lock (_queueLock)
17 | {
18 | if (_queue.Count > 0)
19 | return _queue.Dequeue();
20 | }
21 |
22 | _objectAvailableEvent.WaitOne();
23 |
24 | return Take();
25 | }
26 |
27 | public void Add(T obj)
28 | {
29 | lock (_queueLock)
30 | {
31 | _queue.Enqueue(obj);
32 | }
33 |
34 | _objectAvailableEvent.Set();
35 | }
36 | }
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Compatibility/BlockingCollection.cs:
--------------------------------------------------------------------------------
1 | #if NET35
2 |
3 | using System.Collections.Generic;
4 | using System.Threading;
5 |
6 | namespace XDM.Compatibility
7 | {
8 | public class BlockingCollection
9 | {
10 | private object _queueLock = new();
11 | private Queue _queue = new();
12 | private AutoResetEvent _objectAvailableEvent = new(false);
13 |
14 | public T Take()
15 | {
16 | lock (_queueLock)
17 | {
18 | if (_queue.Count > 0)
19 | return _queue.Dequeue();
20 | }
21 |
22 | _objectAvailableEvent.WaitOne();
23 |
24 | return Take();
25 | }
26 |
27 | public void Add(T obj)
28 | {
29 | lock (_queueLock)
30 | {
31 | _queue.Enqueue(obj);
32 | }
33 |
34 | _objectAvailableEvent.Set();
35 | }
36 | }
37 | }
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Gtk.UI/ButtonWrapper.cs:
--------------------------------------------------------------------------------
1 | using Gtk;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using XDM.Core.UI;
8 |
9 | namespace XDM.GtkUI
10 | {
11 | internal class ButtonWrapper : IButton
12 | {
13 | private readonly Button button;
14 |
15 | public ButtonWrapper(Button button)
16 | {
17 | this.button = button;
18 | button.Clicked += (s, e) =>
19 | {
20 | this.Clicked?.Invoke(s, e);
21 | };
22 | }
23 |
24 | public bool Visible { get => button.Visible; set => button.Visible = value; }
25 |
26 | public bool Enable
27 | {
28 | get => button.Sensitive;
29 | set
30 | {
31 | button.Sensitive = value;
32 | }
33 | }
34 |
35 | public event EventHandler? Clicked;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/ChromeIntegrator/Page2.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/chrome/manifest2.json:
--------------------------------------------------------------------------------
1 | {
2 | "update_url": "https://clients2.google.com/service/update2/crx",
3 | "manifest_version": 2,
4 | "minimum_chrome_version": "18.0",
5 | "name": "Xtreme Download Manager",
6 | "description": "XDM is an open source download manager",
7 | "version": "2.2",
8 | "icons": {
9 | "48": "icon.png",
10 | "128": "icon-128.png"
11 | },
12 | "background": {
13 | "page": "background.html"
14 | },
15 | "browser_action": {
16 | "default_icon": "icon.png"
17 | },
18 | "permissions": [
19 | "activeTab",
20 | "cookies",
21 | "contextMenus",
22 | "webRequest",
23 | "webRequestBlocking",
24 | "*://*/*",
25 | "nativeMessaging"
26 | ],
27 | "commands": {
28 | "toggle-monitoring": {
29 | "suggested_key": {
30 | "default": "Ctrl+Shift+E",
31 | "mac": "Command+Shift+E"
32 | },
33 | "description": "Toggle monitoring"
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox/manifest2.json:
--------------------------------------------------------------------------------
1 | {
2 | "update_url": "https://clients2.google.com/service/update2/crx",
3 | "manifest_version": 2,
4 | "minimum_chrome_version": "18.0",
5 | "name": "Xtreme Download Manager",
6 | "description": "XDM is an open source download manager",
7 | "version": "2.2",
8 | "icons": {
9 | "48": "icon.png",
10 | "128": "icon-128.png"
11 | },
12 | "background": {
13 | "page": "background.html"
14 | },
15 | "browser_action": {
16 | "default_icon": "icon.png"
17 | },
18 | "permissions": [
19 | "activeTab",
20 | "cookies",
21 | "contextMenus",
22 | "webRequest",
23 | "webRequestBlocking",
24 | "*://*/*",
25 | "nativeMessaging"
26 | ],
27 | "commands": {
28 | "toggle-monitoring": {
29 | "suggested_key": {
30 | "default": "Ctrl+Shift+E",
31 | "mac": "Command+Shift+E"
32 | },
33 | "description": "Toggle monitoring"
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/INewVideoDownloadDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using XDM.Core.UI;
6 |
7 | namespace XDM.Core.UI
8 | {
9 | public interface INewVideoDownloadDialog : IFileSelectable
10 | {
11 | void DisposeWindow();
12 | void Invoke(Action callback);
13 | void ShowWindow();
14 | void ShowMessageBox(string text);
15 | string FileSize { get; set; }
16 | public AuthenticationInfo? Authentication { get; set; }
17 | public ProxyInfo? Proxy { get; set; }
18 | public int SpeedLimit { get; set; }
19 | public bool EnableSpeedLimit { get; set; }
20 | public bool ShowMp3Checkbox { get; set; }
21 | public bool IsMp3CheckboxChecked { get; set; }
22 |
23 | event EventHandler DownloadClicked, DestroyEvent, QueueSchedulerClicked, Mp3CheckChanged;
24 | event EventHandler DownloadLaterClicked;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/XDM/XDM_Tests/NanoServerTests.cs:
--------------------------------------------------------------------------------
1 | using HttpServer;
2 | using NUnit.Framework;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Net;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | namespace XDM.SystemTests
12 | {
13 | class NanoServerTests
14 | {
15 | [Test]
16 | public void TestServer()
17 | {
18 | var me = new ManualResetEvent(false);
19 | var server = new NanoServer(IPAddress.Loopback, 5454);
20 | server.RequestReceived += (a, b) =>
21 | {
22 | me.Set();
23 | };
24 | server.Start();
25 | //new Thread(() => server.Start());
26 | //Thread.Sleep(200000000);
27 | ////var wr = WebRequest.CreateHttp("http://127.0.0.1:5454/hello");
28 | ////wr.GetResponse().GetResponseStream().Close();
29 | //me.WaitOne();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/NewDownloadPromptTracker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace XDM.Core
7 | {
8 | public static class NewDownloadPromptTracker
9 | {
10 | private static readonly HashSet newDownloadPrompts = new();
11 |
12 | public static bool IsPromptAlreadyOpen(string url)
13 | {
14 | lock (newDownloadPrompts)
15 | {
16 | return newDownloadPrompts.Contains(url);
17 | }
18 | }
19 |
20 | public static void PromptOpen(string url)
21 | {
22 | lock (newDownloadPrompts)
23 | {
24 | newDownloadPrompts.Add(url);
25 | }
26 | }
27 |
28 | public static void PromptClosed(string url)
29 | {
30 | lock (newDownloadPrompts)
31 | {
32 | newDownloadPrompts.Remove(url);
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IBatchDownloadView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace XDM.Core.UI
7 | {
8 | public interface IBatchDownloadView
9 | {
10 | void SetStartLetterRange(string[] range);
11 | void SetEndLetterRange(string[] range);
12 | void ShowWindow();
13 | void DestroyWindow();
14 |
15 | bool IsLetterMode { get; set; }
16 | bool IsUsingLeadingZero { get; set; }
17 | string Url { get; set; }
18 | char? StartLetter { get; }
19 | char? EndLetter { get; }
20 | int StartNumber { get; }
21 | int EndNumber { get; }
22 | int LeadingZeroCount { get; }
23 | string BatchAddress1 { get; set; }
24 | string BatchAddress2 { get; set; }
25 | string BatchAddressN { get; set; }
26 | bool IsBatchMode { get; }
27 |
28 | event EventHandler? PatternChanged;
29 | event EventHandler? OkClicked;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Win.Installer/make-msi - Copy.bat:
--------------------------------------------------------------------------------
1 | set BUILD_VER=8.0.18
2 |
3 | DEL /s /q *.wixobj
4 | DEL /s /q net4.6.0.wxs
5 | RMDIR /S /Q BIN
6 | RMDIR /S /Q xdm-helper-chrome
7 |
8 | MKDIR BIN
9 | MKDIR BIN\chrome-extension
10 | MKDIR BIN\ext-loader
11 | MKDIR BIN\XDM.App.Host
12 | MKDIR BIN\demo
13 |
14 | dotnet build -c Release -f net4.6.0 ..\XDM.Wpf.UI\XDM.Wpf.UI.csproj -o BIN
15 | dotnet build -c Release -f net4.6.0 ..\XDM.App.Host\XDM.App.Host.csproj -o BIN\XDM.App.Host
16 |
17 | copy /B ffmpeg-x86.exe BIN
18 | git clone https://github.com/subhra74/xdm-helper-chrome.git
19 |
20 | xcopy /E xdm-helper-chrome\chrome\chrome-extension BIN\chrome-extension
21 | xcopy /E xdm-helper-chrome\ext-loader BIN\ext-loader
22 |
23 | xcopy /E demo BIN\demo
24 |
25 | heat dir BIN -o net4.6.0.wxs -scom -frag -srd -sreg -gg -cg NET460 -dr INSTALLFOLDER
26 |
27 | candle product.wxs net4.6.0.wxs
28 | light -ext WixUIExtension -ext WixUtilExtension -cultures:en-us product.wixobj net4.6.0.wixobj -b BIN -out xdmsetup-%BUILD_VER%-x86.msi
29 |
30 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox-old/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 | "minimum_chrome_version": "18.0",
4 | "name": "XDM Browser Monitor",
5 | "description": "XDM integration module for Firefox Quantum",
6 | "version": "2.2",
7 | "icons": {
8 | "48": "icon.png"
9 | },
10 | "background": {
11 | "page": "background.html"
12 | },
13 | "browser_action": {
14 | "default_icon": "icon.png"
15 | },
16 | "permissions": [
17 | "tabs",
18 | "cookies",
19 | "contextMenus",
20 | "activeTab",
21 | "webRequest",
22 | "webRequestBlocking",
23 | "nativeMessaging",
24 | "*://*/*"
25 | ],
26 | "applications": {
27 | "gecko": {
28 | "id": "browser-mon@xdman.sourceforge.net"
29 | }
30 | },
31 | "commands": {
32 | "toggle-monitoring": {
33 | "suggested_key": {
34 | "default": "Ctrl+Shift+E",
35 | "mac": "Command+Shift+E"
36 | },
37 | "description": "Toggle monitoring"
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/translation-generator/translation-gen/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "translation-gen",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.2",
7 | "@testing-library/react": "^12.1.3",
8 | "@testing-library/user-event": "^13.5.0",
9 | "bootstrap": "^5.1.3",
10 | "react": "^17.0.2",
11 | "react-dom": "^17.0.2",
12 | "react-scripts": "5.0.0",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/XDM/XDM.WinForms.IntegrationUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Messaging/XDM.Messaging.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 417407f5-8dba-474e-8ab7-66f2cc33b777
7 |
8 |
9 | XDM.Messaging
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/VideoDownloader/VideoDownloaderPage2.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/VideoDownloader/VideoDownloaderWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/MainWindow/ButtonWrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using XDM.Core.UI;
5 |
6 | namespace XDM.Wpf.UI
7 | {
8 | internal class ButtonWrapper : IButton
9 | {
10 | private Button button;
11 |
12 | public ButtonWrapper(Button button)
13 | {
14 | this.button = button;
15 | this.button.Click += Button_Click;
16 | }
17 |
18 | private void Button_Click(object sender, RoutedEventArgs e)
19 | {
20 | Clicked?.Invoke(sender, e);
21 | }
22 |
23 | public bool Visible
24 | {
25 | get => button.Visibility == Visibility.Visible;
26 | set => button.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
27 | }
28 |
29 | public bool Enable
30 | {
31 | get => button.IsEnabled;
32 | set => button.IsEnabled = value;
33 | }
34 |
35 | public event EventHandler? Clicked;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/VideoDownloader/VideoDownloaderPage2.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace XDM.Wpf.UI.Dialogs.VideoDownloader
16 | {
17 | ///
18 | /// Interaction logic for VideoDownloaderPage2.xaml
19 | ///
20 | public partial class VideoDownloaderPage2 : UserControl
21 | {
22 | public EventHandler? CancelClicked;
23 | public VideoDownloaderPage2()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void Button_Click(object sender, RoutedEventArgs e)
29 | {
30 | CancelClicked?.Invoke(this, EventArgs.Empty);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IUpdaterUI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using XDM.Core;
7 | using XDM.Core.Downloader;
8 |
9 | namespace XDM.Core
10 | {
11 | public interface IUpdaterUI
12 | {
13 | public void DownloadStarted(object? sender, EventArgs e);
14 |
15 | public void DownloadProgressChanged(object? sender, ProgressResultEventArgs e);
16 |
17 | public void DownloadFailed(object? sender, DownloadFailedEventArgs e);
18 |
19 | public void ShowNoUpdateMessage();
20 |
21 | public void DownloadFinished(object? sender, EventArgs e);
22 |
23 | public void DownloadCancelled(object? sender, EventArgs e);
24 |
25 | public event EventHandler? Cancelled;
26 |
27 | public event EventHandler? Finished;
28 |
29 | public event EventHandler? Load;
30 |
31 | public string Label { get; set; }
32 |
33 | public void Show();
34 |
35 | public bool Inderminate { get; set; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/VideoDownloader/VideoDownloaderPage4.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 | using XDM.Core;
15 | using XDM.Core.Util;
16 |
17 | namespace XDM.Wpf.UI.Dialogs.VideoDownloader
18 | {
19 | ///
20 | /// Interaction logic for VideoDownloaderPage4.xaml
21 | ///
22 | public partial class VideoDownloaderPage4 : UserControl
23 | {
24 | public VideoDownloaderPage4()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | private void Button_Click(object sender, RoutedEventArgs e)
30 | {
31 | PlatformHelper.OpenBrowser(Links.VideoDownloadTutorialUrl);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Util/TimeHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace XDM.Core.Util
4 | {
5 | public static class TimeHelper
6 | {
7 | public static void ConvertH24ToH12(TimeSpan time, out int hrs, out int min, out bool am)
8 | {
9 | var hour = time.Hours;
10 | if (hour < 12)
11 | {
12 | am = true;
13 | hrs = hour == 0 ? 12 : hour;
14 | }
15 | else
16 | {
17 | am = false;
18 | hrs = hour > 12 ? hour - 12 : hour;
19 | }
20 | min = time.Minutes;
21 | }
22 |
23 | public static TimeSpan ConvertH12ToH24(int hrs, int min, bool am)
24 | {
25 | var hour = 0;
26 | if (am)
27 | {
28 | hour = hrs == 12 ? 0 : hrs;
29 | }
30 | else
31 | {
32 | hour = hrs < 12 ? hrs + 12 : hrs;
33 | }
34 | return new TimeSpan(hour, min, 0);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/MediaParser/Dash/Representation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace XDM.Core.MediaParser.Dash
5 | {
6 | public class Representation
7 | {
8 | public int Width { get; }
9 | public int Height { get; }
10 | public string Codec { get; }
11 | public long Bandwidth { get; }
12 | public long Duration { get; }
13 | public List Segments { get; }
14 | public string MimeType { get; }
15 | public string Language { get; }
16 |
17 | public Representation(List segments, int width, int height,
18 | string codec, long bandwidth, long duration, string mimeType, string language)
19 | {
20 | this.Segments = segments;
21 | this.Width = width;
22 | this.Height = height;
23 | this.Codec = codec;
24 | this.Bandwidth = bandwidth;
25 | this.Duration = duration;
26 | this.MimeType = mimeType;
27 | this.Language = language;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/IProgressWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 |
7 | namespace XDM.Core.UI
8 | {
9 | public interface IProgressWindow
10 | {
11 | public string FileNameText { get; set; }
12 |
13 | public string UrlText { get; set; }
14 |
15 | public string FileSizeText { get; set; }
16 |
17 | public string DownloadSpeedText { get; set; }
18 |
19 | public string DownloadETAText { get; set; }
20 |
21 | public int DownloadProgress { get; set; }
22 |
23 | public string DownloadId { get; set; }
24 |
25 | public void ShowProgressWindow();
26 |
27 | public void DownloadCancelled();
28 |
29 | public void DownloadFailed(ErrorDetails error);
30 |
31 | public void DownloadStarted();
32 |
33 | public void DestroyWindow();
34 | }
35 |
36 | public struct ErrorDetails
37 | {
38 | public int Code { get; set; }
39 | public string Message { get; set; }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/XDM.Core.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 5bbea202-65d2-481a-b457-6d8fcc8970d7
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/VideoDownloader/VideoDownloaderPage4.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Messaging/XDM.Messaging.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 417407f5-8dba-474e-8ab7-66f2cc33b777
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/XDM/NativeMessaging/NativeMessaging.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ec82d5e3-4a98-4fbf-be18-88a085d12290
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Compatibility/XDM.Compatibility.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 6bffa6bc-bf01-450e-96b7-9a1d3dcc2333
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/ChromeIntegrator/Page1.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/Adaptive/Dash/MultiSourceDASHDownloadInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace XDM.Core.Downloader.Adaptive.Dash
5 | {
6 | public class MultiSourceDASHDownloadInfo : MultiSourceDownloadInfo
7 | {
8 | public List AudioSegments { get; set; }
9 | public List VideoSegments { get; set; }
10 | public long Duration { get; set; }
11 | public string Url { get; set; }
12 | public string VideoMimeType { get; set; }
13 | public string AudioMimeType { get; set; }
14 | public string VideoFormat { get; set; }
15 | public string AudioFormat { get; set; }
16 | //public int Width { get; }
17 | //public int Height { get; }
18 | //public string VideoCodec { get; }
19 | //public string AudioCodec { get; }
20 | //public long VideoBandwidth { get; }
21 | //public long VideoDuration { get; }
22 | //public long AudioBandwidth { get; }
23 | //public long AudioDuration { get; }
24 | //public string Language { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/SkinResourceDictionary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 |
7 | namespace XDM.Wpf.UI
8 | {
9 | public class SkinResourceDictionary : ResourceDictionary
10 | {
11 | private Uri _darkSource;
12 | private Uri _lightSource;
13 |
14 | public Uri DarkSource
15 | {
16 | get { return _darkSource; }
17 | set
18 | {
19 | _darkSource = value;
20 | UpdateSource();
21 | }
22 | }
23 | public Uri LightSource
24 | {
25 | get { return _lightSource; }
26 | set
27 | {
28 | _lightSource = value;
29 | UpdateSource();
30 | }
31 | }
32 |
33 | private void UpdateSource()
34 | {
35 | var val = App.Skin == Skin.Dark ? DarkSource : LightSource;
36 | if (val != null && base.Source != val)
37 | base.Source = val;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/XDM/NativeMessaging/IpcClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Net;
5 | using System.Net.Sockets;
6 | using System.Text;
7 |
8 | namespace NativeMessaging
9 | {
10 | public class IpcClient
11 | {
12 | private TcpClient? _socket;
13 | private Stream? _socketIn;
14 | private Stream? _socketOut;
15 |
16 | public void Connect(int port)
17 | {
18 | _socket = new TcpClient(AddressFamily.InterNetwork);
19 | _socket.Connect(new IPEndPoint(IPAddress.Loopback, port));
20 | _socketIn = _socket.GetStream();
21 | _socketOut = _socket.GetStream();
22 | }
23 |
24 | public void Send(IEnumerable args)
25 | {
26 | IpcUtil.Send(_socketOut!, args);
27 | }
28 |
29 | public IEnumerable Receive()
30 | {
31 | return IpcUtil.Receive(_socketIn!);
32 | }
33 |
34 | public void Close()
35 | {
36 | try { _socket?.Close(); } catch { }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/Widget/FloatingWidget.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Forms;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace XDM.Wpf.UI.Dialogs.Widget
16 | {
17 | ///
18 | /// Interaction logic for FloatingWidget.xaml
19 | ///
20 | public partial class FloatingWidget : Window
21 | {
22 | public FloatingWidget()
23 | {
24 | InitializeComponent();
25 | var rect = Screen.PrimaryScreen.WorkingArea;
26 | Left = rect.Width - 300;
27 | Top = rect.Height - 100;
28 | }
29 |
30 | private void Window_MouseDown(object sender, MouseButtonEventArgs e)
31 | {
32 | if (e.ChangedButton == MouseButton.Left)
33 | this.DragMove();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Clients/Http/IHttpSession.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Net;
6 | using System.Text;
7 | using XDM.Core;
8 |
9 | namespace XDM.Core.Clients.Http
10 | {
11 | internal interface IHttpSession : IDisposable
12 | {
13 | public void AddRange(long range);
14 |
15 | public void AddRange(long start, long end);
16 |
17 | public string? ContentType { get; }
18 |
19 | public bool Compressed { get; }
20 |
21 | public string? ContentDispositionFileName { get; }
22 |
23 | public long ContentLength { get; }
24 |
25 | public DateTime LastModified { get; }
26 |
27 | public HttpStatusCode StatusCode { get; }
28 |
29 | public string ReadAsString(CancelFlag cancellationToken);
30 |
31 | public void EnsureSuccessStatusCode();
32 |
33 | public Uri ResponseUri { get; }
34 |
35 | public void Close();
36 |
37 | public Stream GetResponseStream();
38 |
39 | public void Abort();
40 |
41 | public long GetTotalLengthFromContentRange();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/TraceLog/Log.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 |
4 | namespace TraceLog
5 | {
6 | public static class Log
7 | {
8 | public static void InitFileBasedTrace(string logfile)
9 | {
10 | try
11 | {
12 | Trace.WriteLine("Log init...");
13 | //Trace.Listeners.RemoveAt(0);
14 | Trace.Listeners.Add(new TextWriterTraceListener(logfile, "myListener"));
15 | Trace.AutoFlush = true;
16 | Trace.WriteLine("Log init...");
17 | }
18 | catch (Exception ex)
19 | {
20 | Trace.WriteLine(ex.ToString());
21 | }
22 | }
23 |
24 | public static void Debug(object obj, string message)
25 | {
26 | Trace.WriteLine($"[xdm-{DateTime.Now.ToLongTimeString()}] {message} : {obj}");
27 | //Trace.Flush();
28 | }
29 |
30 | public static void Debug(string message)
31 | {
32 | Trace.WriteLine($"[xdm-{DateTime.Now.ToLongTimeString()}] {message}");
33 | //Trace.Flush();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/firefox/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 | "minimum_chrome_version": "18.0",
4 | "name": "XDM Browser Monitor",
5 | "description": "XDM integration module for Firefox Quantum",
6 | "version": "2.2",
7 | "icons": {
8 | "48": "icon.png",
9 | "128": "icon-128.png"
10 | },
11 | "background": {
12 | "scripts": [
13 | "init.js",
14 | "util.js",
15 | "lib.js",
16 | "messaging.js",
17 | "bg2.js"
18 | ]
19 | },
20 | "browser_action": {
21 | "default_icon": "icon.png"
22 | },
23 | "permissions": [
24 | "tabs",
25 | "cookies",
26 | "contextMenus",
27 | "activeTab",
28 | "webRequest",
29 | "webRequestBlocking",
30 | "nativeMessaging",
31 | "downloads",
32 | "*://*/*"
33 | ],
34 | "applications": {
35 | "gecko": {
36 | "id": "browser-mon@xdman.sourceforge.net"
37 | }
38 | },
39 | "commands": {
40 | "toggle-monitoring": {
41 | "suggested_key": {
42 | "default": "Ctrl+Shift+E",
43 | "mac": "Command+Shift+E"
44 | },
45 | "description": "Toggle monitoring"
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/app/XDM/Lang/Traditional Chinese - Taiwan.txt:
--------------------------------------------------------------------------------
1 | ALL_UNFINISHED=正在進行
2 | ALL_FINISHED=已完成
3 | CAT_DOCUMENTS=檔案
4 | CAT_COMPRESSED=壓縮檔案
5 | CAT_MUSIC=音樂
6 | CAT_VIDEOS=影片
7 | CAT_PROGRAMS=程式
8 | MENU_BATCH_DOWNLOAD=批量下載
9 | MENU_DELETE_DWN=刪除此下載
10 | MENU_DELETE_COMPLETED=清除已完成
11 | MENU_IMPORT=匯入
12 | MENU_EXPORT=匯出
13 | MENU_EXIT=結束
14 | MENU_PAUSE=暫停
15 | MENU_RESUME=繼續
16 | MENU_RESTART=重新開始
17 | MENU_REFRESH_LINK=重新整理連結
18 | MENU_PROPERTIES=屬性
19 | MENU_UPDATE=檢查更新
20 | MENU_ABOUT=關於 XDM...
21 | SORT_DATE=按時間
22 | SORT_SIZE=按大小
23 | SORT_NAME=按名稱
24 | ND_CANCEL=取消
25 | MSG_OK=確定
26 | LBL_MENU=選單
27 | TITLE_SETTINGS=設定
28 | SETTINGS_MONITORING=瀏覽器監視延伸模組
29 | DESC_NEW=新增
30 | DESC_DEL=刪除
31 | DESC_Q_TITLE=佇列和下載安排
32 | Q_SCHEDULE_TXT=調度安排
33 | Q_MOVE_TO=移動到
34 | CTX_OPEN_FILE=打開
35 | CTX_OPEN_FOLDER=打開目錄
36 | CTX_SAVE_AS=另存為
37 | CTX_COPY_URL=複製URL
38 | CTX_COPY_FILE=複製檔案
39 | MENU_IMPORT=匯入
40 | MENU_EXPORT=匯出
41 | MENU_LANG=語言
42 | MSG_LANG1=選擇語言
43 | MSG_LANG2=請註意,變更將在下次啟動XDM時生效
44 | LBL_REPORT_PROBLEM=報告一個bug
45 | LBL_SUPPORT_PAGE=支援頁面
46 | LBL_SHOW_PROGRESS=顯示進度
47 | SORT_STATUS=Status
48 | LBL_SEARCH=Search
49 | LBL_VIDEO_DOWNLOAD=Video download
50 | LBL_NEW_DOWNLOAD=New download
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/RefreshLink/LinkRefreshWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/new_browser_ext/main.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | import RequestWatcher from './lib/request-watcher.js';
3 | import Logger from './lib/logger.js';
4 |
5 | const logger=new Logger();
6 |
7 | const xdmNS = {
8 | cancelCallback: function () {
9 | logger.log("download cancelled");
10 | },
11 | onDownloadCreated: function (downloadItem) {
12 | logger.log("onDownloadCreated");
13 | logger.log(downloadItem);
14 | chrome.downloads.cancel(
15 | downloadItem.id,
16 | this.cancelCallback
17 | );
18 | },
19 | onDeterminingFilename: function (downloadItem, suggest) {
20 | logger.log("onDeterminingFilename");
21 | logger.log(downloadItem);
22 | suggest();
23 | },
24 | init: function () {
25 | logger.log("extension initialized...");
26 | let requestWatcher = new RequestWatcher();
27 | chrome.downloads.onCreated.addListener(
28 | this.onDownloadCreated
29 | );
30 | chrome.downloads.onDeterminingFilename.addListener(
31 | this.onDeterminingFilename
32 | );
33 | }
34 | };
35 |
36 | xdmNS.init();
37 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Downloader/Progressive/Piece.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 |
4 | namespace XDM.Core.Downloader.Progressive
5 | {
6 | public class Piece
7 | {
8 | private long offset, length, downloaded;
9 | private SegmentState state;
10 | public long Offset
11 | {
12 | get => Interlocked.Read(ref offset);
13 | set => Interlocked.Exchange(ref offset, value);
14 | }
15 | public long Length
16 | {
17 | get => Interlocked.Read(ref length);
18 | set => Interlocked.Exchange(ref length, value);
19 | }
20 | public long Downloaded
21 | {
22 | get => Interlocked.Read(ref downloaded);
23 | set => Interlocked.Exchange(ref downloaded, value);
24 | }
25 | public SegmentState State
26 | {
27 | get { lock (this) { return this.state; } }
28 | set { lock (this) { this.state = value; } }
29 | }
30 | public string Id { get; set; }
31 | public StreamType StreamType { get; set; }
32 | }
33 |
34 | public enum StreamType
35 | {
36 | Primary, Secondary
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Clients/Http/ProxyHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using TraceLog;
7 | using XDM.Core;
8 |
9 | namespace XDM.Core.Clients.Http
10 | {
11 | internal static class ProxyHelper
12 | {
13 | internal static IWebProxy? GetProxy(ProxyInfo? proxy)
14 | {
15 | if (proxy.HasValue)
16 | {
17 | Log.Debug("Proxy type: " + proxy.Value.ProxyType);
18 | if (proxy.Value.ProxyType == ProxyType.Direct)
19 | {
20 | return new WebProxy();
21 | }
22 | else if (proxy.Value.ProxyType == ProxyType.Custom)
23 | {
24 | var p = new WebProxy(proxy.Value.Host, proxy.Value.Port);
25 | if (!string.IsNullOrEmpty(proxy.Value.UserName))
26 | {
27 | p.Credentials = new NetworkCredential(proxy.Value.UserName, proxy.Value.Password);
28 | }
29 | return p;
30 | }
31 | }
32 | return null;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Gtk.UI/FinishedEntryWrapper.cs:
--------------------------------------------------------------------------------
1 | using Gtk;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using XDM.Core;
8 | using XDM.Core.UI;
9 | using XDM.Core;
10 |
11 | namespace XDM.GtkUI
12 | {
13 | internal class FinishedEntryWrapper : IFinishedDownloadRow
14 | {
15 | private FinishedDownloadItem entry;
16 | private TreeIter treeIter;
17 | private ITreeModel store;
18 |
19 | public FinishedEntryWrapper(FinishedDownloadItem entry, TreeIter treeIter, ITreeModel store)
20 | {
21 | this.entry = entry;
22 | this.treeIter = treeIter;
23 | this.store = store;
24 | }
25 |
26 | public string FileIconText => IconResource.GetSVGNameForFileType(DownloadEntry.Name);
27 |
28 | public string Name => entry.Name;
29 |
30 | public long Size => entry.Size;
31 |
32 | public DateTime DateAdded => entry.DateAdded;
33 |
34 | public FinishedDownloadItem DownloadEntry => entry;
35 |
36 | internal TreeIter TreeIter => treeIter;
37 |
38 | internal ITreeModel Store => store;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Compatibility/XDM.Compatibility.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 6bffa6bc-bf01-450e-96b7-9a1d3dcc2333
7 |
8 |
9 | XDM.Compatibility
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/XDM/Lang/Korea.txt:
--------------------------------------------------------------------------------
1 | ALL_UNFINISHED=미완료
2 | ALL_FINISHED=완료
3 | CAT_DOCUMENTS=문서
4 | CAT_COMPRESSED=압축됨
5 | CAT_MUSIC=음악
6 | CAT_VIDEOS=비디오
7 | CAT_PROGRAMS=프로그램
8 | MENU_BATCH_DOWNLOAD=배치 다운로드
9 | MENU_DELETE_DWN=다운로드 삭제
10 | MENU_DELETE_COMPLETED=클리어 완료
11 | MENU_IMPORT=Import
12 | MENU_EXPORT=Export
13 | MENU_EXIT=종료
14 | MENU_PAUSE=일시 중지
15 | MENU_RESUME=계속
16 | MENU_RESTART=다시 시작
17 | MENU_REFRESH_LINK=리프레시 링크
18 | MENU_PROPERTIES=속성
19 | MENU_UPDATE=업데이트 확인
20 | MENU_ABOUT=XDM 정보
21 | SORT_DATE=날짜
22 | SORT_SIZE=사이즈
23 | SORT_NAME=이름
24 | ND_CANCEL=취소
25 | MSG_OK=OK
26 | LBL_MENU=메뉴
27 | TITLE_SETTINGS=설정
28 | SETTINGS_MONITORING=브라우저 모니터링
29 | DESC_NEW=새로 만들기
30 | DESC_DEL=삭제
31 | DESC_Q_TITLE=큐 및 스케줄러
32 | Q_SCHEDULE_TXT=스케줄러
33 | Q_MOVE_TO=이동하기
34 | CTX_OPEN_FILE=열림
35 | CTX_OPEN_FOLDER=폴더 열기
36 | CTX_SAVE_AS=다른 이름으로 저장
37 | CTX_COPY_URL=URL 복사
38 | CTX_COPY_FILE=파일 복사
39 | MENU_IMPORT=Import
40 | MENU_EXPORT=Export
41 | MENU_LANG=언어
42 | MSG_LANG1=언어 선택
43 | MSG_LANG2=다음 번에 XDM을 시작할 때 변경 사항이 적용된다는 점에 유의하십시오.
44 | LBL_REPORT_PROBLEM=버그리포트
45 | LBL_SUPPORT_PAGE=지원페이지
46 | LBL_SHOW_PROGRESS=진행 표시
47 | SORT_STATUS=Status
48 | LBL_SEARCH=Search
49 | LBL_VIDEO_DOWNLOAD=Video download
50 | LBL_NEW_DOWNLOAD=New download
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/Clients/Http/HttpClientFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using XDM.Core;
6 |
7 | namespace XDM.Core.Clients.Http
8 | {
9 | public static class HttpClientFactory
10 | {
11 | public static IHttpClient NewHttpClient(ProxyInfo? proxyInfo)
12 | {
13 | ProxyInfo? proxy = null;
14 | if (proxyInfo.HasValue)
15 | {
16 | if (proxyInfo.Value.ProxyType != ProxyType.Custom)
17 | {
18 | proxy = proxyInfo;
19 | }
20 | else if (!string.IsNullOrEmpty(proxyInfo.Value.Host) && proxyInfo.Value.Port > 0)
21 | {
22 | proxy = proxyInfo;
23 | }
24 | }
25 |
26 | if (Environment.Version.Major == 2)
27 | {
28 | return new WinHttpClient(proxy);
29 | }
30 | else
31 | {
32 | #if NET5_0_OR_GREATER
33 | return new DotNetHttpClient(proxy);
34 | #else
35 | return new NetFxHttpClient(proxy);
36 | #endif
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Core/UI/DownloadCompleteUIController.cs:
--------------------------------------------------------------------------------
1 | using XDM.Core;
2 | using XDM.Core.Util;
3 |
4 | namespace XDM.Core.UI
5 | {
6 | public static class DownloadCompleteUIController
7 | {
8 | public static void ShowDialog(IDownloadCompleteDialog dwnCmpldDlg, string file, string folder)
9 | {
10 | dwnCmpldDlg.FileNameText = file;
11 | dwnCmpldDlg.FolderText = folder;
12 | dwnCmpldDlg.FileOpenClicked += (sender, args) =>
13 | {
14 | if (!string.IsNullOrEmpty(args.Path))
15 | {
16 | PlatformHelper.OpenFile(args.Path!);
17 | }
18 | };
19 | dwnCmpldDlg.FolderOpenClicked += (sender, args) =>
20 | {
21 | if (!string.IsNullOrEmpty(args.Path))
22 | {
23 | PlatformHelper.OpenFolder(args.Path!, args.FileName);
24 | }
25 | };
26 | dwnCmpldDlg.DontShowAgainClickd += (sender, args) =>
27 | {
28 | Config.Instance.ShowDownloadCompleteWindow = false;
29 | };
30 | dwnCmpldDlg.ShowDownloadCompleteDialog();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/xdm-browser-monitor--depricated/chrome/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "update_url": "https://clients2.google.com/service/update2/crx",
3 | "manifest_version": 2,
4 | "minimum_chrome_version": "18.0",
5 | "name": "Xtreme Download Manager",
6 | "description": "XDM is an open source download manager",
7 | "version": "2.2",
8 | "icons": {
9 | "48": "icon.png",
10 | "128": "icon-128.png"
11 | },
12 | "background": {
13 | "scripts": [
14 | "init.js",
15 | "util.js",
16 | "lib.js",
17 | "messaging.js",
18 | "bg2.js"
19 | ]
20 | },
21 | "browser_action": {
22 | "default_icon": "icon.png"
23 | },
24 | "permissions": [
25 | "activeTab",
26 | "cookies",
27 | "contextMenus",
28 | "webRequest",
29 | "*://*/*",
30 | "nativeMessaging",
31 | "downloads"
32 | ],
33 | "commands": {
34 | "toggle-monitoring": {
35 | "suggested_key": {
36 | "default": "Ctrl+Shift+E",
37 | "mac": "Command+Shift+E"
38 | },
39 | "description": "Toggle monitoring"
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/app/XDM/XDM.Gtk.UI/MenuItemWrapper.cs:
--------------------------------------------------------------------------------
1 | using Gtk;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using XDM.Core.UI;
8 |
9 | namespace XDM.GtkUI
10 | {
11 | internal class MenuItemWrapper : IMenuItem
12 | {
13 | private MenuItem menuItem;
14 | private string name;
15 | public string Name => name;
16 | public MenuItem MenuItem => menuItem;
17 |
18 | public bool Enabled
19 | {
20 | get => menuItem.IsSensitive;
21 | set => menuItem.Sensitive = value;
22 | }
23 |
24 | public event EventHandler? Clicked;
25 |
26 | public MenuItemWrapper(string name, string text, bool visible = true)
27 | {
28 | this.name = name;
29 | this.menuItem = new MenuItem(text);
30 | this.menuItem.Name = name;
31 | if (visible)
32 | {
33 | this.menuItem.ShowAll();
34 | }
35 | this.menuItem.Activated += Mi_Click;
36 | }
37 |
38 | private void Mi_Click(object? sender, EventArgs e)
39 | {
40 | this.Clicked?.Invoke(sender, e);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | ### XDM is currently being re-written to be more user friendly and performant, please refer to (https://github.com/subhra74/xdm/discussions/768) for more information ###
8 |
9 | **PLEASE DO NOT JUST SAY "It does not work, or something not working etc." Provide enough relevent details so that the issue can be analyzed and reproduced easily**
10 |
11 | **Describe the bug**
12 | A clear and concise description of what the bug is.
13 |
14 | **To Reproduce**
15 | Steps to reproduce the behavior:
16 | 1. Go to '...'
17 | 2. Click on '....'
18 | 3. Scroll down to '....'
19 | 4. See error
20 |
21 | **Expected behavior**
22 | A clear and concise description of what you expected to happen.
23 |
24 | **Screenshots**
25 | If applicable, add screenshots to help explain your problem.
26 |
27 | **please complete the following information:**
28 | - OS: [e.g. Linux/Windows]
29 | - Browser [e.g. chrome, Firefox]
30 | - XDM addon Version [e.g. 2.0]
31 | - XDM Version [e.g. 7.2.0]
32 |
33 | **Generated log using below method**
34 | - https://github.com/subhra74/xdm/wiki/Generate-log-for-troubleshooting
35 |
36 | **Additional context**
37 | Add any other context about the problem here.
38 |
--------------------------------------------------------------------------------
/app/XDM/XDM.Wpf.UI/Dialogs/Updater/UpdaterWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------